Skip to content

Commit bb0ae7d

Browse files
committed
Show error message boxes on Windows during init in case an error.
1 parent 504a7d5 commit bb0ae7d

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

src/engine_lib/src/render/renderer.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
#include <window.h>
2929
#include <world.h>
3030
#include <glad/glad.h>
31+
#include <SDL3/SDL_messagebox.h>
3132

3233
// Stuff needed to calculate FPS and keep frame limit.
3334
typedef struct te_renderer_frame_stats {
@@ -120,12 +121,19 @@ renderer_create(struct te_window* window) {
120121
// Create GL context.
121122
renderer->gl_context = SDL_GL_CreateContext(prv_window_get_sdl_window(window));
122123
if (renderer->gl_context == NULL) {
124+
#if defined(WIN32)
125+
SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Error", SDL_GetError(), NULL);
126+
#endif
123127
log_error(SDL_GetError());
124128
abort();
125129
}
126130

127131
// Initialize GLAD.
128132
if (gladLoadGLES2Loader((GLADloadproc)SDL_GL_GetProcAddress) == 0) {
133+
#if defined(WIN32)
134+
SDL_ShowSimpleMessageBox(
135+
SDL_MESSAGEBOX_ERROR, "Error", "failed to load OpenGL ES", NULL);
136+
#endif
129137
log_error("failed to load OpenGL ES");
130138
abort();
131139
}

0 commit comments

Comments
 (0)