From bc11af703e622dcc95ac337ad1a68db2d4cc16c0 Mon Sep 17 00:00:00 2001 From: 3gg <3gg@shellblade.net> Date: Sat, 15 Jun 2024 11:43:47 -0700 Subject: Move glad initialization to gfx-app. --- app/include/gfx/app.h | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'app/include') 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 { KeyZ, } Key; +#ifdef __cplusplus +extern "C" { +#endif + /// Create a window with an OpenGL context and run the main loop. bool gfx_app_run(const GfxAppDesc*, const GfxAppCallbacks*); @@ -69,6 +73,10 @@ void gfx_app_get_mouse_position(double* x, double* y); /// Return true if the given key is pressed. bool gfx_is_key_pressed(Key); +#ifdef __cplusplus +} // extern "C" +#endif + /// Define a main function that initializes and puts the application in a loop. /// See also: gfx_app_run(). #define GFX_APP_MAIN(WIDTH, HEIGHT, MAX_FPS, TITLE) \ @@ -86,10 +94,10 @@ bool gfx_is_key_pressed(Key); .app_state = &app_state, \ }, \ &(GfxAppCallbacks){ \ - .init = (GfxAppInit)app_init, \ - .update = (GfxAppUpdate)app_update, \ - .render = (GfxAppRender)app_render, \ - .resize = (GfxAppResize)app_resize, \ - .shutdown = (GfxAppShutdown)app_end}); \ + .init = (GfxAppInit)Init, \ + .shutdown = (GfxAppShutdown)Shutdown, \ + .update = (GfxAppUpdate)Update, \ + .render = (GfxAppRender)Render, \ + .resize = (GfxAppResize)Resize}); \ return 0; \ } -- cgit v1.2.3