From 74663901436b4dda91dcdd32d5a762aac1635300 Mon Sep 17 00:00:00 2001 From: Roderick Colenbrander Date: Sun, 3 Dec 2006 22:40:24 +0100 Subject: [PATCH] wgl: (W)GL_NV_vertex_array_range. --- dlls/winex11.drv/opengl.c | 46 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/dlls/winex11.drv/opengl.c b/dlls/winex11.drv/opengl.c index 94739bb6fc6..465f2ef430c 100644 --- a/dlls/winex11.drv/opengl.c +++ b/dlls/winex11.drv/opengl.c @@ -244,6 +244,10 @@ static BOOL (*pglXReleaseTexImageARB)(Display *dpy, GLXPbuffer pbuffer, int buf static BOOL (*pglXDrawableAttribARB)(Display *dpy, GLXDrawable draw, const int *attribList); static int (*pglXSwapIntervalSGI)(int); +/* NV GLX Extension */ +static void* (*pglXAllocateMemoryNV)(GLsizei size, GLfloat readfreq, GLfloat writefreq, GLfloat priority); +static void (*pglXFreeMemoryNV)(GLvoid *pointer); + /* Standard OpenGL */ MAKE_FUNCPTR(glBindTexture) MAKE_FUNCPTR(glBitmap) @@ -370,6 +374,10 @@ LOAD_FUNCPTR(glXMakeContextCurrent) LOAD_FUNCPTR(glXGetCurrentReadDrawable) LOAD_FUNCPTR(glXGetFBConfigs) +/* NV GLX Extension */ +LOAD_FUNCPTR(glXAllocateMemoryNV) +LOAD_FUNCPTR(glXFreeMemoryNV) + /* Standard OpenGL calls */ LOAD_FUNCPTR(glBindTexture) LOAD_FUNCPTR(glBitmap) @@ -2588,6 +2596,32 @@ static BOOL WINAPI X11DRV_wglSwapIntervalEXT(int interval) { return TRUE; } +/** + * X11DRV_wglAllocateMemoryNV + * + * WGL_NV_vertex_array_range: wglAllocateMemoryNV + */ +static void* WINAPI X11DRV_wglAllocateMemoryNV(GLsizei size, GLfloat readfreq, GLfloat writefreq, GLfloat priority) { + TRACE("(%d, %f, %f, %f)\n", size, readfreq, writefreq, priority ); + if (pglXAllocateMemoryNV == NULL) + return NULL; + + return pglXAllocateMemoryNV(size, readfreq, writefreq, priority); +} + +/** + * X11DRV_wglFreeMemoryNV + * + * WGL_NV_vertex_array_range: wglFreeMemoryNV + */ +static void WINAPI X11DRV_wglFreeMemoryNV(GLvoid* pointer) { + TRACE("(%p)\n", pointer); + if (pglXFreeMemoryNV == NULL) + return; + + pglXFreeMemoryNV(pointer); +} + /** * glxRequireVersion (internal) * @@ -2709,6 +2743,14 @@ static const WineGLExtension WGL_EXT_swap_control = } }; +static const WineGLExtension WGL_NV_vertex_array_range = +{ + "WGL_NV_vertex_array_range", + { + { "wglAllocateMemoryNV", X11DRV_wglAllocateMemoryNV }, + { "wglFreeMemoryNV", X11DRV_wglFreeMemoryNV }, + } +}; /** * X11DRV_WineGL_LoadExtensions @@ -2745,6 +2787,10 @@ static void X11DRV_WineGL_LoadExtensions(void) if (glxRequireExtension("GLX_SGI_swap_control")) register_extension(&WGL_EXT_swap_control); + + /* The OpenGL extension GL_NV_vertex_array_range adds wgl/glX functions which aren't exported as 'real' wgl/glX extensions. */ + if(strstr(WineGLInfo.glExtensions, "GL_NV_vertex_array_range") != NULL) + register_extension(&WGL_NV_vertex_array_range); }