|
3 | 3 | // SPDX-License-Identifier: Apache-2.0
|
4 | 4 |
|
5 | 5 | #include "pch.h"
|
| 6 | + |
| 7 | +#ifdef __MINGW32__ |
| 8 | +#define GL_ATTRIBUTE __attribute__((stdcall)) |
| 9 | +#else |
| 10 | +#define GL_ATTRIBUTE |
| 11 | +#endif |
6 | 12 | #include "common.h"
|
7 | 13 | #include "geometry.h"
|
8 | 14 | #include "graphicsplugin.h"
|
@@ -149,17 +155,15 @@ struct OpenGLGraphicsPlugin : public IGraphicsPlugin {
|
149 | 155 |
|
150 | 156 | #if !defined(XR_USE_PLATFORM_MACOS)
|
151 | 157 | glEnable(GL_DEBUG_OUTPUT);
|
152 |
| - glDebugMessageCallback( |
153 |
| - [](GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar* message, |
154 |
| - const void* userParam) { |
155 |
| - ((OpenGLGraphicsPlugin*)userParam)->DebugMessageCallback(source, type, id, severity, length, message); |
156 |
| - }, |
157 |
| - this); |
| 158 | + glDebugMessageCallback((GLDEBUGPROC)&OpenGLGraphicsPlugin::DebugMessageCallbackTrampoline, this); |
158 | 159 | #endif // !defined(XR_USE_PLATFORM_MACOS)
|
159 | 160 |
|
160 | 161 | InitializeResources();
|
161 | 162 | }
|
162 |
| - |
| 163 | + static void GL_ATTRIBUTE DebugMessageCallbackTrampoline(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, |
| 164 | + const GLchar* message, const void* userParam) { |
| 165 | + ((OpenGLGraphicsPlugin*)userParam)->DebugMessageCallback(source, type, id, severity, length, message); |
| 166 | + } |
163 | 167 | void InitializeResources() {
|
164 | 168 | glGenFramebuffers(1, &m_swapchainFramebuffer);
|
165 | 169 |
|
|
0 commit comments