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/src/app.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'app/src/app.c') diff --git a/app/src/app.c b/app/src/app.c index b6d10ca..1e636af 100644 --- a/app/src/app.c +++ b/app/src/app.c @@ -1,5 +1,7 @@ #include +#include + #include #include #include @@ -110,6 +112,12 @@ bool gfx_app_run(const GfxAppDesc* desc, const GfxAppCallbacks* callbacks) { } glfwMakeContextCurrent(g_gfx_app.window); + // Load GL before calling the application init clalback. + if (!gladLoadGL()) { + LOGE("Failed loading glad!"); + return 0; + } + // Initialize the application's state before setting any callbacks. if (!(*g_gfx_app.callbacks.init)( g_gfx_app.app_state, desc->argc, desc->argv)) { -- cgit v1.2.3