diff options
author | 3gg <3gg@shellblade.net> | 2024-06-15 11:43:47 -0700 |
---|---|---|
committer | 3gg <3gg@shellblade.net> | 2024-06-15 11:43:47 -0700 |
commit | bc11af703e622dcc95ac337ad1a68db2d4cc16c0 (patch) | |
tree | ec2ad303bb5a9ef1983b3e2f6fe88aec25a8d4a5 /app/include | |
parent | 6dedc3c72f0772bee98a3e2dd01430603e8b2d58 (diff) |
Move glad initialization to gfx-app.
Diffstat (limited to 'app/include')
-rw-r--r-- | app/include/gfx/app.h | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/app/include/gfx/app.h b/app/include/gfx/app.h index ffff4bc..3843d92 100644 --- a/app/include/gfx/app.h +++ b/app/include/gfx/app.h | |||
@@ -60,6 +60,10 @@ typedef enum Key { | |||
60 | KeyZ, | 60 | KeyZ, |
61 | } Key; | 61 | } Key; |
62 | 62 | ||
63 | #ifdef __cplusplus | ||
64 | extern "C" { | ||
65 | #endif | ||
66 | |||
63 | /// Create a window with an OpenGL context and run the main loop. | 67 | /// Create a window with an OpenGL context and run the main loop. |
64 | bool gfx_app_run(const GfxAppDesc*, const GfxAppCallbacks*); | 68 | bool gfx_app_run(const GfxAppDesc*, const GfxAppCallbacks*); |
65 | 69 | ||
@@ -69,6 +73,10 @@ void gfx_app_get_mouse_position(double* x, double* y); | |||
69 | /// Return true if the given key is pressed. | 73 | /// Return true if the given key is pressed. |
70 | bool gfx_is_key_pressed(Key); | 74 | bool gfx_is_key_pressed(Key); |
71 | 75 | ||
76 | #ifdef __cplusplus | ||
77 | } // extern "C" | ||
78 | #endif | ||
79 | |||
72 | /// Define a main function that initializes and puts the application in a loop. | 80 | /// Define a main function that initializes and puts the application in a loop. |
73 | /// See also: gfx_app_run(). | 81 | /// See also: gfx_app_run(). |
74 | #define GFX_APP_MAIN(WIDTH, HEIGHT, MAX_FPS, TITLE) \ | 82 | #define GFX_APP_MAIN(WIDTH, HEIGHT, MAX_FPS, TITLE) \ |
@@ -86,10 +94,10 @@ bool gfx_is_key_pressed(Key); | |||
86 | .app_state = &app_state, \ | 94 | .app_state = &app_state, \ |
87 | }, \ | 95 | }, \ |
88 | &(GfxAppCallbacks){ \ | 96 | &(GfxAppCallbacks){ \ |
89 | .init = (GfxAppInit)app_init, \ | 97 | .init = (GfxAppInit)Init, \ |
90 | .update = (GfxAppUpdate)app_update, \ | 98 | .shutdown = (GfxAppShutdown)Shutdown, \ |
91 | .render = (GfxAppRender)app_render, \ | 99 | .update = (GfxAppUpdate)Update, \ |
92 | .resize = (GfxAppResize)app_resize, \ | 100 | .render = (GfxAppRender)Render, \ |
93 | .shutdown = (GfxAppShutdown)app_end}); \ | 101 | .resize = (GfxAppResize)Resize}); \ |
94 | return 0; \ | 102 | return 0; \ |
95 | } | 103 | } |