mirror of
https://github.com/ZDoom/Raze.git
synced 2025-02-11 22:47:27 +00:00
Polymer: support for creating a debugging context in winlayer
This also fixes a warning when building for Windows. git-svn-id: https://svn.eduke32.com/eduke32@2067 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
a0b928583b
commit
f08610b6c8
5 changed files with 32 additions and 6 deletions
|
@ -319,6 +319,7 @@ extern int32_t (WINAPI * bwglDescribePixelFormat)(HDC,int32_t,UINT,LPPIXELFORMAT
|
||||||
extern int32_t (WINAPI * bwglGetPixelFormat)(HDC);
|
extern int32_t (WINAPI * bwglGetPixelFormat)(HDC);
|
||||||
extern BOOL (WINAPI * bwglSetPixelFormat)(HDC,int32_t,const PIXELFORMATDESCRIPTOR*);
|
extern BOOL (WINAPI * bwglSetPixelFormat)(HDC,int32_t,const PIXELFORMATDESCRIPTOR*);
|
||||||
extern BOOL (WINAPI * bwglSwapIntervalEXT)(int32_t);
|
extern BOOL (WINAPI * bwglSwapIntervalEXT)(int32_t);
|
||||||
|
extern HGLRC (WINAPI * bwglCreateContextAttribsARB)(HDC hDC, HGLRC hShareContext, const int *attribList);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//////// glGenTextures/glDeleteTextures debugging ////////
|
//////// glGenTextures/glDeleteTextures debugging ////////
|
||||||
|
|
|
@ -373,7 +373,7 @@ static void polymer_prepareshadows(void);
|
||||||
// RENDER TARGETS
|
// RENDER TARGETS
|
||||||
static void polymer_initrendertargets(int32_t count);
|
static void polymer_initrendertargets(int32_t count);
|
||||||
// DEBUG OUTPUT
|
// DEBUG OUTPUT
|
||||||
static void polymer_debugoutputcallback(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,GLvoid *userParam);
|
void PR_CALLBACK polymer_debugoutputcallback(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,GLvoid *userParam);
|
||||||
|
|
||||||
#define INDICE(n) ((p->indices) ? (p->indices[(i+n)%p->indicescount]*5) : (((i+n)%p->vertcount)*5))
|
#define INDICE(n) ((p->indices) ? (p->indices[(i+n)%p->indicescount]*5) : (((i+n)%p->vertcount)*5))
|
||||||
|
|
||||||
|
|
|
@ -287,6 +287,7 @@ int32_t (WINAPI *bwglDescribePixelFormat)(HDC,int32_t,UINT,LPPIXELFORMATDESCRIPT
|
||||||
int32_t (WINAPI *bwglGetPixelFormat)(HDC);
|
int32_t (WINAPI *bwglGetPixelFormat)(HDC);
|
||||||
BOOL (WINAPI *bwglSetPixelFormat)(HDC,int32_t,const PIXELFORMATDESCRIPTOR *);
|
BOOL (WINAPI *bwglSetPixelFormat)(HDC,int32_t,const PIXELFORMATDESCRIPTOR *);
|
||||||
BOOL (WINAPI *bwglSwapIntervalEXT)(int32_t);
|
BOOL (WINAPI *bwglSwapIntervalEXT)(int32_t);
|
||||||
|
HGLRC (WINAPI * bwglCreateContextAttribsARB)(HDC hDC, HGLRC hShareContext, const int *attribList);
|
||||||
|
|
||||||
static HANDLE hGLDLL, hGLUDLL;
|
static HANDLE hGLDLL, hGLUDLL;
|
||||||
#else
|
#else
|
||||||
|
@ -625,6 +626,7 @@ int32_t loadglextensions(void)
|
||||||
|
|
||||||
#ifdef RENDERTYPEWIN
|
#ifdef RENDERTYPEWIN
|
||||||
bwglSwapIntervalEXT = GETPROCEXTSOFT("wglSwapIntervalEXT");
|
bwglSwapIntervalEXT = GETPROCEXTSOFT("wglSwapIntervalEXT");
|
||||||
|
bwglCreateContextAttribsARB = GETPROCEXTSOFT("wglCreateContextAttribsARB");
|
||||||
#endif
|
#endif
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
|
@ -5662,7 +5662,7 @@ static void polymer_initrendertargets(int32_t count)
|
||||||
}
|
}
|
||||||
|
|
||||||
// DEBUG OUTPUT
|
// DEBUG OUTPUT
|
||||||
void polymer_debugoutputcallback(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,GLvoid *userParam)
|
void PR_CALLBACK polymer_debugoutputcallback(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,GLvoid *userParam)
|
||||||
{
|
{
|
||||||
UNREFERENCED_PARAMETER(source);
|
UNREFERENCED_PARAMETER(source);
|
||||||
UNREFERENCED_PARAMETER(type);
|
UNREFERENCED_PARAMETER(type);
|
||||||
|
|
|
@ -2803,6 +2803,7 @@ static int32_t SetupOpenGL(int32_t width, int32_t height, int32_t bitspp)
|
||||||
}
|
}
|
||||||
|
|
||||||
hGLRC = bwglCreateContext(hDC);
|
hGLRC = bwglCreateContext(hDC);
|
||||||
|
|
||||||
if (!hGLRC)
|
if (!hGLRC)
|
||||||
{
|
{
|
||||||
ReleaseOpenGL();
|
ReleaseOpenGL();
|
||||||
|
@ -2817,6 +2818,32 @@ static int32_t SetupOpenGL(int32_t width, int32_t height, int32_t bitspp)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
loadglextensions();
|
||||||
|
|
||||||
|
// We should really be checking for the new WGL extension string instead
|
||||||
|
// Enable this to leverage ARB_debug_output
|
||||||
|
if (bwglCreateContextAttribsARB && 0) {
|
||||||
|
HGLRC debuggingContext = hGLRC;
|
||||||
|
|
||||||
|
// This corresponds to WGL_CONTEXT_FLAGS_ARB set to WGL_CONTEXT_DEBUG_BIT_ARB
|
||||||
|
// I'm too lazy to get a new wglext.h
|
||||||
|
int attribs[] = {
|
||||||
|
0x2094, 0x1,
|
||||||
|
0
|
||||||
|
};
|
||||||
|
|
||||||
|
debuggingContext = bwglCreateContextAttribsARB(hDC, NULL, attribs);
|
||||||
|
|
||||||
|
if (debuggingContext) {
|
||||||
|
bwglDeleteContext(hGLRC);
|
||||||
|
bwglMakeCurrent(hDC, debuggingContext);
|
||||||
|
hGLRC = debuggingContext;
|
||||||
|
|
||||||
|
// This should be able to get the ARB_debug_output symbols
|
||||||
|
loadglextensions();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
polymost_glreset();
|
polymost_glreset();
|
||||||
|
|
||||||
bglEnable(GL_TEXTURE_2D);
|
bglEnable(GL_TEXTURE_2D);
|
||||||
|
@ -3234,10 +3261,6 @@ static BOOL CreateAppWindow(int32_t modenum)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef USE_OPENGL
|
|
||||||
if (bitspp > 8) loadglextensions();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
xres = width;
|
xres = width;
|
||||||
yres = height;
|
yres = height;
|
||||||
bpp = bitspp;
|
bpp = bitspp;
|
||||||
|
|
Loading…
Reference in a new issue