Skip to content

Instantly share code, notes, and snippets.

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 8394d031..86abec2b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -27,6 +27,13 @@ project(
LANGUAGES C CXX
)
+set(DAWN_LIBRARY_DIR "${Dawn_BINARY_DIR}/lib")
+
@hugoam
hugoam / function.h
Created January 22, 2019 11:15
function.h
template <typename T>
class function;
template <typename Return, typename... Args>
class function<Return(Args...)>
{
public:
function() {}
template <class T, typename = typename enable_if<is_invocable<T, Args...>::value>::type>
@hugoam
hugoam / Game.cpp
Last active October 20, 2018 15:22
minimal game
class MyGame : public GameModule
{
public:
MyGame(Module& module) : GameModule(module) {}
virtual void init(GameShell& app, Game& game) final
{
this->start(app, game);
}
@hugoam
hugoam / game.lua
Last active October 19, 2018 20:46
minimal toy build scripts
toy.all = table.union(mud.mud, toy.toy)
game = mud_module(nil, "game", path.join(GAME_DIR, "src"), "game", nil, nil, nil, toy.all)
toy_shell("game", { game })
-- add project specific configuration here
@hugoam
hugoam / ex_boid.cpp
Last active September 29, 2018 15:17
boid example
//#define STD_HASHMAP
#define FLAT_HASHMAP
#ifdef STD_HASHMAP
#include <unordered_map>
#elif defined FLAT_HASHMAP
#include <flat_hash_map.hpp>
#endif
#include <boids/ex_boids.h>
#if BGFX_SHADER_LANGUAGE_GLSL == 110
mat4 transpose(in mat4 mat)
{
vec4 i0 = mat[0];
vec4 i1 = mat[1];
vec4 i2 = mat[2];
vec4 i3 = mat[3];
mat4 result = mat4(
vec4(i0.x, i1.x, i2.x, i3.x),
@hugoam
hugoam / main.cpp
Last active April 15, 2018 20:46
Minimal bgfx
void main()
{
// window context creation code goes here
bgfx::PlatformData pd = {};
pd.nwh = // windows native handle goes here
bgfx::setPlatformData(pd);
bgfx::init();