This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
To include a library as a subtree, follow these steps: | |
1. Add the project as a remote | |
git remote add <remote-name> <source-repo> | |
2. Fetch the remote | |
git fetch <remote-name> | |
3. Add the project | |
git subtree add --prefix "path/to/project" <remote-name> <remote-branch-name> --squash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// References | |
// | |
// [1] Sloan, P.-P., Luna, B., and Snyder, J. 2005. | |
// Local, deformable precomputedradiance transfer. | |
// ACM Trans. Graph. 24, 3, 1216–1223 | |
// | |
// [2] Stupid Spherical Harmonics (SH) Tricks | |
// Peter-Pike Sloan, Microsoft Corporation |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "Reflection.h" | |
#include <string> | |
#include <vector> | |
namespace mks | |
{ | |
struct Rect | |
{ | |
int top; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <TinyCRT/TinyCRT.h> | |
#include <TinyCRT/TinyWindows.h> | |
namespace | |
{ | |
constexpr uint64_t time100NSecsPerSec = 10000000; | |
uint64_t FileTimeToU64(FILETIME ft) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
uint32_t NextPow2(uint32_t v) | |
{ | |
v--; | |
v |= (v >> 1); | |
v |= (v >> 2); | |
v |= (v >> 4); | |
v |= (v >> 8); | |
v |= (v >> 16); | |
v++; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | = dot product, ^ = cross product. Please forgive my younger self for his sins. | |
void UpdateMinMax(float value, float& min, float& max) | |
{ | |
if (value < min) | |
min = value; | |
else if (value > max) | |
max = value; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define out OutCatcher() << | |
template <typename TYPE> struct Out | |
{ | |
explicit Out(TYPE& ref) : ref(ref) { } | |
TYPE& ref; | |
}; | |
struct OutCatcher | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ------------------------------------------------------------------------------------------------------------------------------- | |
// Opaque Object Containers: Provide RAII/Move semantics for opaque pointers. | |
// ------------------------------------------------------------------------------------------------------------------------------- | |
// Opaque handles must implement the commented out types/functions | |
template <typename Type> | |
struct ctrOpaqueTypeTraits | |
{ | |
// using Type = OpaqueType; | |
// static constexpr auto New = Type_New; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// LIB | |
using Buffer = std::vector<uint8_t>; | |
// LIB | |
struct Command | |
{ | |
int size; | |
// NOTE: This *does not* need to be virtual - it's just the way std::function achieves it... | |
virtual void Call() = 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DerivePointerAlignment: false | |
PointerAlignment: Left |