From 21f6eeaaebbf28de2855af6db912d795c117c931 Mon Sep 17 00:00:00 2001 From: dhewg Date: Thu, 29 Dec 2011 16:50:35 +0100 Subject: [PATCH] Move wgl* function pointers Most are only used in the unused draw_exp.cpp, move them there. --- neo/renderer/draw_exp.cpp | 32 ++++++++++++++++++++++++++++++++ neo/sys/win32/win_glimp.cpp | 28 ---------------------------- neo/sys/win32/win_local.h | 15 --------------- 3 files changed, 32 insertions(+), 43 deletions(-) diff --git a/neo/renderer/draw_exp.cpp b/neo/renderer/draw_exp.cpp index c4099a86..ae72066e 100644 --- a/neo/renderer/draw_exp.cpp +++ b/neo/renderer/draw_exp.cpp @@ -55,6 +55,22 @@ polygon offset factor causes occasional texture holes from highly angled texture */ +// WGL_ARB_pixel_format +static PFNWGLGETPIXELFORMATATTRIBIVARBPROC wglGetPixelFormatAttribivARB; +static PFNWGLGETPIXELFORMATATTRIBFVARBPROC wglGetPixelFormatAttribfvARB; + +// WGL_ARB_pbuffer +static PFNWGLCREATEPBUFFERARBPROC wglCreatePbufferARB; +static PFNWGLGETPBUFFERDCARBPROC wglGetPbufferDCARB; +static PFNWGLRELEASEPBUFFERDCARBPROC wglReleasePbufferDCARB; +static PFNWGLDESTROYPBUFFERARBPROC wglDestroyPbufferARB; +static PFNWGLQUERYPBUFFERARBPROC wglQueryPbufferARB; + +// WGL_ARB_render_texture +static PFNWGLBINDTEXIMAGEARBPROC wglBindTexImageARB; +static PFNWGLRELEASETEXIMAGEARBPROC wglReleaseTexImageARB; +static PFNWGLSETPBUFFERATTRIBARBPROC wglSetPbufferAttribARB; + static bool initialized; static int lightBufferSize = 1024; @@ -508,6 +524,22 @@ void R_Exp_Allocate( void ) { initialized = true; + // WGL_ARB_pixel_format + wglGetPixelFormatAttribivARB = (PFNWGLGETPIXELFORMATATTRIBIVARBPROC)GLimp_ExtensionPointer("wglGetPixelFormatAttribivARB"); + wglGetPixelFormatAttribfvARB = (PFNWGLGETPIXELFORMATATTRIBFVARBPROC)GLimp_ExtensionPointer("wglGetPixelFormatAttribfvARB"); + + // WGL_ARB_pbuffer + wglCreatePbufferARB = (PFNWGLCREATEPBUFFERARBPROC)GLimp_ExtensionPointer("wglCreatePbufferARB"); + wglGetPbufferDCARB = (PFNWGLGETPBUFFERDCARBPROC)GLimp_ExtensionPointer("wglGetPbufferDCARB"); + wglReleasePbufferDCARB = (PFNWGLRELEASEPBUFFERDCARBPROC)GLimp_ExtensionPointer("wglReleasePbufferDCARB"); + wglDestroyPbufferARB = (PFNWGLDESTROYPBUFFERARBPROC)GLimp_ExtensionPointer("wglDestroyPbufferARB"); + wglQueryPbufferARB = (PFNWGLQUERYPBUFFERARBPROC)GLimp_ExtensionPointer("wglQueryPbufferARB"); + + // WGL_ARB_render_texture + wglBindTexImageARB = (PFNWGLBINDTEXIMAGEARBPROC)GLimp_ExtensionPointer("wglBindTexImageARB"); + wglReleaseTexImageARB = (PFNWGLRELEASETEXIMAGEARBPROC)GLimp_ExtensionPointer("wglReleaseTexImageARB"); + wglSetPbufferAttribARB = (PFNWGLSETPBUFFERATTRIBARBPROC)GLimp_ExtensionPointer("wglSetPbufferAttribARB"); + #if 1 // // allocate the floating point rendering buffer diff --git a/neo/sys/win32/win_glimp.cpp b/neo/sys/win32/win_glimp.cpp index d75b4c0c..c2643404 100644 --- a/neo/sys/win32/win_glimp.cpp +++ b/neo/sys/win32/win_glimp.cpp @@ -58,22 +58,8 @@ static PFNWGLGETEXTENSIONSSTRINGARBPROC wglGetExtensionsStringARB; PFNWGLSWAPINTERVALEXTPROC wglSwapIntervalEXT; // WGL_ARB_pixel_format -PFNWGLGETPIXELFORMATATTRIBIVARBPROC wglGetPixelFormatAttribivARB; -PFNWGLGETPIXELFORMATATTRIBFVARBPROC wglGetPixelFormatAttribfvARB; PFNWGLCHOOSEPIXELFORMATARBPROC wglChoosePixelFormatARB; -// WGL_ARB_pbuffer -PFNWGLCREATEPBUFFERARBPROC wglCreatePbufferARB; -PFNWGLGETPBUFFERDCARBPROC wglGetPbufferDCARB; -PFNWGLRELEASEPBUFFERDCARBPROC wglReleasePbufferDCARB; -PFNWGLDESTROYPBUFFERARBPROC wglDestroyPbufferARB; -PFNWGLQUERYPBUFFERARBPROC wglQueryPbufferARB; - -// WGL_ARB_render_texture -PFNWGLBINDTEXIMAGEARBPROC wglBindTexImageARB; -PFNWGLRELEASETEXIMAGEARBPROC wglReleaseTexImageARB; -PFNWGLSETPBUFFERATTRIBARBPROC wglSetPbufferAttribARB; - /* ARB_pixel_format */ #define WGL_NUMBER_PIXEL_FORMATS_ARB 0x2000 #define WGL_DRAW_TO_WINDOW_ARB 0x2001 @@ -290,21 +276,7 @@ void GLW_CheckWGLExtensions( HDC hDC ) { r_swapInterval.SetModified(); // force a set next frame // WGL_ARB_pixel_format - wglGetPixelFormatAttribivARB = (PFNWGLGETPIXELFORMATATTRIBIVARBPROC)GLimp_ExtensionPointer("wglGetPixelFormatAttribivARB"); - wglGetPixelFormatAttribfvARB = (PFNWGLGETPIXELFORMATATTRIBFVARBPROC)GLimp_ExtensionPointer("wglGetPixelFormatAttribfvARB"); wglChoosePixelFormatARB = (PFNWGLCHOOSEPIXELFORMATARBPROC)GLimp_ExtensionPointer("wglChoosePixelFormatARB"); - - // WGL_ARB_pbuffer - wglCreatePbufferARB = (PFNWGLCREATEPBUFFERARBPROC)GLimp_ExtensionPointer("wglCreatePbufferARB"); - wglGetPbufferDCARB = (PFNWGLGETPBUFFERDCARBPROC)GLimp_ExtensionPointer("wglGetPbufferDCARB"); - wglReleasePbufferDCARB = (PFNWGLRELEASEPBUFFERDCARBPROC)GLimp_ExtensionPointer("wglReleasePbufferDCARB"); - wglDestroyPbufferARB = (PFNWGLDESTROYPBUFFERARBPROC)GLimp_ExtensionPointer("wglDestroyPbufferARB"); - wglQueryPbufferARB = (PFNWGLQUERYPBUFFERARBPROC)GLimp_ExtensionPointer("wglQueryPbufferARB"); - - // WGL_ARB_render_texture - wglBindTexImageARB = (PFNWGLBINDTEXIMAGEARBPROC)GLimp_ExtensionPointer("wglBindTexImageARB"); - wglReleaseTexImageARB = (PFNWGLRELEASETEXIMAGEARBPROC)GLimp_ExtensionPointer("wglReleaseTexImageARB"); - wglSetPbufferAttribARB = (PFNWGLSETPBUFFERATTRIBARBPROC)GLimp_ExtensionPointer("wglSetPbufferAttribARB"); } /* diff --git a/neo/sys/win32/win_local.h b/neo/sys/win32/win_local.h index 033d999f..ae9c0401 100644 --- a/neo/sys/win32/win_local.h +++ b/neo/sys/win32/win_local.h @@ -52,23 +52,8 @@ If you have questions concerning this license or the applicable additional terms extern PFNWGLSWAPINTERVALEXTPROC wglSwapIntervalEXT; // WGL_ARB_pixel_format -extern PFNWGLGETPIXELFORMATATTRIBIVARBPROC wglGetPixelFormatAttribivARB; -extern PFNWGLGETPIXELFORMATATTRIBFVARBPROC wglGetPixelFormatAttribfvARB; extern PFNWGLCHOOSEPIXELFORMATARBPROC wglChoosePixelFormatARB; -// WGL_ARB_pbuffer -extern PFNWGLCREATEPBUFFERARBPROC wglCreatePbufferARB; -extern PFNWGLGETPBUFFERDCARBPROC wglGetPbufferDCARB; -extern PFNWGLRELEASEPBUFFERDCARBPROC wglReleasePbufferDCARB; -extern PFNWGLDESTROYPBUFFERARBPROC wglDestroyPbufferARB; -extern PFNWGLQUERYPBUFFERARBPROC wglQueryPbufferARB; - -// WGL_ARB_render_texture -extern PFNWGLBINDTEXIMAGEARBPROC wglBindTexImageARB; -extern PFNWGLRELEASETEXIMAGEARBPROC wglReleaseTexImageARB; -extern PFNWGLSETPBUFFERATTRIBARBPROC wglSetPbufferAttribARB; - - #define MAX_OSPATH 256 #define WINDOW_STYLE (WS_OVERLAPPED|WS_BORDER|WS_CAPTION|WS_VISIBLE | WS_THICKFRAME)