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/src | |
parent | 6dedc3c72f0772bee98a3e2dd01430603e8b2d58 (diff) |
Move glad initialization to gfx-app.
Diffstat (limited to 'app/src')
-rw-r--r-- | app/src/app.c | 8 |
1 files changed, 8 insertions, 0 deletions
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 @@ | |||
1 | #include <gfx/app.h> | 1 | #include <gfx/app.h> |
2 | 2 | ||
3 | #include <glad/glad.h> | ||
4 | |||
3 | #include <GLFW/glfw3.h> | 5 | #include <GLFW/glfw3.h> |
4 | #include <log/log.h> | 6 | #include <log/log.h> |
5 | #include <timer.h> | 7 | #include <timer.h> |
@@ -110,6 +112,12 @@ bool gfx_app_run(const GfxAppDesc* desc, const GfxAppCallbacks* callbacks) { | |||
110 | } | 112 | } |
111 | glfwMakeContextCurrent(g_gfx_app.window); | 113 | glfwMakeContextCurrent(g_gfx_app.window); |
112 | 114 | ||
115 | // Load GL before calling the application init clalback. | ||
116 | if (!gladLoadGL()) { | ||
117 | LOGE("Failed loading glad!"); | ||
118 | return 0; | ||
119 | } | ||
120 | |||
113 | // Initialize the application's state before setting any callbacks. | 121 | // Initialize the application's state before setting any callbacks. |
114 | if (!(*g_gfx_app.callbacks.init)( | 122 | if (!(*g_gfx_app.callbacks.init)( |
115 | g_gfx_app.app_state, desc->argc, desc->argv)) { | 123 | g_gfx_app.app_state, desc->argc, desc->argv)) { |