diff options
| author | 3gg <3gg@shellblade.net> | 2023-01-05 09:10:42 -0800 | 
|---|---|---|
| committer | 3gg <3gg@shellblade.net> | 2023-01-05 09:10:42 -0800 | 
| commit | 47d6a4d1c2973664dc79edd0043fe63dd1e369c6 (patch) | |
| tree | 9f583193edc876dbc44b5293bb6dd965a9e0230a /gltfview | |
| parent | 134282937e724f33f9cc18731024346373e6c38c (diff) | |
Add ability to set shader compiler defines.
Diffstat (limited to 'gltfview')
| -rw-r--r-- | gltfview/src/main.c | 32 | 
1 files changed, 17 insertions, 15 deletions
| diff --git a/gltfview/src/main.c b/gltfview/src/main.c index f7c372c..f4863b4 100644 --- a/gltfview/src/main.c +++ b/gltfview/src/main.c | |||
| @@ -12,7 +12,7 @@ static bool init(const GfxAppDesc* desc, void** app_state) { | |||
| 12 | return false; | 12 | return false; | 
| 13 | } | 13 | } | 
| 14 | if (!game_new(game, desc->argc, desc->argv)) { | 14 | if (!game_new(game, desc->argc, desc->argv)) { | 
| 15 | LOGE("Failed to initialize game\n"); | 15 | LOGE("Failed to initialize game"); | 
| 16 | return false; | 16 | return false; | 
| 17 | } | 17 | } | 
| 18 | *app_state = game; | 18 | *app_state = game; | 
| @@ -44,22 +44,24 @@ static void resize(void* app_state, int width, int height) { | |||
| 44 | } | 44 | } | 
| 45 | 45 | ||
| 46 | int main(int argc, const char** argv) { | 46 | int main(int argc, const char** argv) { | 
| 47 | const int initial_width = 1350; | 47 | const int initial_width = 1350; | 
| 48 | const int initial_height = 900; | 48 | const int initial_height = 900; | 
| 49 | const int max_fps = 60; | 49 | const int max_fps = 60; | 
| 50 | 50 | ||
| 51 | gfx_app_run(&(GfxAppDesc){.argc = argc, | 51 | gfx_app_run( | 
| 52 | .argv = argv, | 52 | &(GfxAppDesc){ | 
| 53 | .width = initial_width, | 53 | .argc = argc, | 
| 54 | .height = initial_height, | 54 | .argv = argv, | 
| 55 | .max_fps = max_fps, | 55 | .width = initial_width, | 
| 56 | .update_delta_time = | 56 | .height = initial_height, | 
| 57 | max_fps > 0 ? 1.0 / (double)max_fps : 0.0}, | 57 | .max_fps = max_fps, | 
| 58 | &(GfxAppCallbacks){.init = init, | 58 | .update_delta_time = max_fps > 0 ? 1.0 / (double)max_fps : 0.0}, | 
| 59 | .update = update, | 59 | &(GfxAppCallbacks){ | 
| 60 | .render = render, | 60 | .init = init, | 
| 61 | .resize = resize, | 61 | .update = update, | 
| 62 | .shutdown = shutdown}); | 62 | .render = render, | 
| 63 | .resize = resize, | ||
| 64 | .shutdown = shutdown}); | ||
| 63 | 65 | ||
| 64 | return 0; | 66 | return 0; | 
| 65 | } | 67 | } | 
