project swapping setup

This commit is contained in:
randy 2024-07-02 12:48:28 +07:00
parent f66e89087e
commit 9866eae1b8
4 changed files with 59 additions and 15 deletions

10
build.c
View file

@ -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"
#include "entry_engine_test.c"
// #include "entry_minimal_example.c"
// #include "entry_randygame.c"

View file

@ -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;

26
entry_minimal_example.c Normal file
View file

@ -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;
}

26
entry_randygame.c Normal file
View file

@ -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;
}