Skip to content

Commit

Permalink
OpenGL: Fix crash related to wxWidgets handling of vsync (#1112)
Browse files Browse the repository at this point in the history
  • Loading branch information
goeiecool9999 committed Mar 10, 2024
1 parent a2d7497 commit e143506
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/Cafe/HW/Latte/Renderer/OpenGL/OpenGLRenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,14 @@
#define STRINGIFY2(X) #X
#define STRINGIFY(X) STRINGIFY2(X)

namespace CemuGL
{
#define GLFUNC(__type, __name) __type __name;
#define EGLFUNC(__type, __name) __type __name;
#include "Common/GLInclude/glFunctions.h"
#undef GLFUNC
#undef EGLFUNC
}

#include "config/ActiveSettings.h"
#include "config/LaunchSettings.h"
Expand Down Expand Up @@ -241,6 +244,17 @@ void LoadOpenGLImports()
#undef GLFUNC
#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
void LoadOpenGLImports()
{
Expand Down
4 changes: 4 additions & 0 deletions src/Common/GLInclude/GLInclude.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ typedef struct __GLXFBConfigRec *GLXFBConfig;

#endif

namespace CemuGL
{
#define GLFUNC(__type, __name) extern __type __name;
#define EGLFUNC(__type, __name) extern __type __name;
#include "glFunctions.h"
Expand Down Expand Up @@ -213,6 +215,8 @@ static void glCompressedTextureSubImage3DWrapper(GLenum target, GLuint texture,
glBindTexture(target, originalTexture);
}

}
using namespace CemuGL;
// this prevents Windows GL.h from being included:
#define __gl_h_
#define __GL_H__

0 comments on commit e143506

Please sign in to comment.