OpenGL: Fix crash related to wxWidgets handling of vsync (#1112)

This commit is contained in:
goeiecool9999 2024-03-11 00:57:31 +01:00 committed by GitHub
parent a2d74972d4
commit e1435066ee
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 18 additions and 0 deletions

View File

@ -24,11 +24,14 @@
#define STRINGIFY2(X) #X #define STRINGIFY2(X) #X
#define STRINGIFY(X) STRINGIFY2(X) #define STRINGIFY(X) STRINGIFY2(X)
namespace CemuGL
{
#define GLFUNC(__type, __name) __type __name; #define GLFUNC(__type, __name) __type __name;
#define EGLFUNC(__type, __name) __type __name; #define EGLFUNC(__type, __name) __type __name;
#include "Common/GLInclude/glFunctions.h" #include "Common/GLInclude/glFunctions.h"
#undef GLFUNC #undef GLFUNC
#undef EGLFUNC #undef EGLFUNC
}
#include "config/ActiveSettings.h" #include "config/ActiveSettings.h"
#include "config/LaunchSettings.h" #include "config/LaunchSettings.h"
@ -241,6 +244,17 @@ void LoadOpenGLImports()
#undef GLFUNC #undef GLFUNC
#undef EGLFUNC #undef EGLFUNC
} }
#if BOOST_OS_LINUX
// dummy function for all code that is statically linked with cemu and attempts to use eglSwapInterval
// used to suppress wxWidgets calls to eglSwapInterval
extern "C"
EGLAPI EGLBoolean EGLAPIENTRY eglSwapInterval(EGLDisplay dpy, EGLint interval)
{
return EGL_TRUE;
}
#endif
#elif BOOST_OS_MACOS #elif BOOST_OS_MACOS
void LoadOpenGLImports() void LoadOpenGLImports()
{ {

View File

@ -36,6 +36,8 @@ typedef struct __GLXFBConfigRec *GLXFBConfig;
#endif #endif
namespace CemuGL
{
#define GLFUNC(__type, __name) extern __type __name; #define GLFUNC(__type, __name) extern __type __name;
#define EGLFUNC(__type, __name) extern __type __name; #define EGLFUNC(__type, __name) extern __type __name;
#include "glFunctions.h" #include "glFunctions.h"
@ -213,6 +215,8 @@ static void glCompressedTextureSubImage3DWrapper(GLenum target, GLuint texture,
glBindTexture(target, originalTexture); glBindTexture(target, originalTexture);
} }
}
using namespace CemuGL;
// this prevents Windows GL.h from being included: // this prevents Windows GL.h from being included:
#define __gl_h_ #define __gl_h_
#define __GL_H__ #define __GL_H__