diff --git a/build.c b/build.c index 07beb53..5e01fb4 100644 --- a/build.c +++ b/build.c @@ -18,12 +18,12 @@ typedef struct Context_Extra { #define GFX_RENDERER GFX_RENDERER_D3D11 -#define ENTRY_PROC start // This is "entry" by default but we're not like all the other girls so we call it start - #include "oogabooga/oogabooga.c" -// Includes for game goes here -// ... +// +// Comment & Uncomment to swap projects -#include "test_game.c" \ No newline at end of file +#include "entry_engine_test.c" +// #include "entry_minimal_example.c" +// #include "entry_randygame.c" \ No newline at end of file diff --git a/test_game.c b/entry_engine_test.c similarity index 90% rename from test_game.c rename to entry_engine_test.c index d55d946..22d8295 100644 --- a/test_game.c +++ b/entry_engine_test.c @@ -1,16 +1,8 @@ -Vector4 hex_to_rgba(s64 hex) { - u8 r = (hex>>24) & 0x000000FF; - u8 g = (hex>>16) & 0x000000FF; - u8 b = (hex>>8) & 0x000000FF; - u8 a = (hex>>0) & 0x000000FF; - return (Vector4){r/255.0, g/255.0, b/255.0, a/255.0}; -} - -int start(int argc, char **argv) { +int entry(int argc, char **argv) { - window.title = fixed_string("My epic game"); + window.title = fixed_string("Engine Testing Example"); window.width = 1280; window.height = 720; window.x = 200; diff --git a/entry_minimal_example.c b/entry_minimal_example.c new file mode 100644 index 0000000..6d8fb15 --- /dev/null +++ b/entry_minimal_example.c @@ -0,0 +1,26 @@ + +int entry(int argc, char **argv) { + + window.title = fixed_string("Minimal Game Example"); + window.width = 1280; + window.height = 720; + window.x = 200; + window.y = 200; + window.clear_color = v4(1, 1, 1, 1); + + while (!window.should_close) { + reset_temporary_storage(); + + os_update(); + + float64 now = os_get_current_time_in_seconds(); + Matrix4 hammer_xform = m4_scalar(1.0); + hammer_xform = m4_rotate_z(hammer_xform, (f32)now); + hammer_xform = m4_translate(hammer_xform, v3(-.25f, -.25f, 0)); + draw_rect_xform(hammer_xform, v2(.5f, .5f), COLOR_RED); + + gfx_update(); + } + + return 0; +} \ No newline at end of file diff --git a/entry_randygame.c b/entry_randygame.c new file mode 100644 index 0000000..dcf20f0 --- /dev/null +++ b/entry_randygame.c @@ -0,0 +1,26 @@ + +int entry(int argc, char **argv) { + + window.title = fixed_string("Randy's Game"); + window.width = 1280; + window.height = 720; + window.x = 200; + window.y = 200; + window.clear_color = v4(1, 1, 1, 1); + + while (!window.should_close) { + reset_temporary_storage(); + + os_update(); + + float64 now = os_get_current_time_in_seconds(); + Matrix4 hammer_xform = m4_scalar(1.0); + hammer_xform = m4_rotate_z(hammer_xform, (f32)now); + hammer_xform = m4_translate(hammer_xform, v3(-.25f, -.25f, 0)); + draw_rect_xform(hammer_xform, v2(.5f, .5f), COLOR_RED); + + gfx_update(); + } + + return 0; +} \ No newline at end of file