mirror of
https://git.eden-emu.dev/eden-emu/eden.git
synced 2025-07-21 05:15:47 +00:00
Frontends, VideoCore: Move glad initialisation to the frontend
On SDL2 this allows it to use SDL_GL_GetProcAddress() instead of the default function loader, and fixes a crash when using apitrace with an EGL context. On Qt we will need to migrate from QGLWidget to QOpenGLWidget and QOpenGLContext before we can use gladLoadGLLoader() instead of gladLoadGL(), since the former doesn’t expose a function loader.
This commit is contained in:
parent
200e9d03b2
commit
f20454b97c
3 changed files with 18 additions and 6 deletions
|
@ -9,6 +9,8 @@
|
|||
#define SDL_MAIN_HANDLED
|
||||
#include <SDL.h>
|
||||
|
||||
#include <glad/glad.h>
|
||||
|
||||
#include "common/key_map.h"
|
||||
#include "common/logging/log.h"
|
||||
#include "common/scm_rev.h"
|
||||
|
@ -98,6 +100,11 @@ EmuWindow_SDL2::EmuWindow_SDL2() {
|
|||
exit(1);
|
||||
}
|
||||
|
||||
if (!gladLoadGLLoader(static_cast<GLADloadproc>(SDL_GL_GetProcAddress))) {
|
||||
LOG_CRITICAL(Frontend, "Failed to initialize GL functions! Exiting...");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
OnResize();
|
||||
OnMinimalClientAreaChangeRequest(GetActiveConfig().min_client_area_size);
|
||||
SDL_PumpEvents();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue