Roderick Colenbrander : wgl: (W)GL_NV_vertex_array_range.

Alexandre Julliard julliard at wine.codeweavers.com
Mon Dec 4 07:16:59 CST 2006


Module: wine
Branch: master
Commit: 74663901436b4dda91dcdd32d5a762aac1635300
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=74663901436b4dda91dcdd32d5a762aac1635300

Author: Roderick Colenbrander <thunderbird2k at gmx.net>
Date:   Sun Dec  3 22:40:24 2006 +0100

wgl: (W)GL_NV_vertex_array_range.

---

 dlls/winex11.drv/opengl.c |   46 +++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 46 insertions(+), 0 deletions(-)

diff --git a/dlls/winex11.drv/opengl.c b/dlls/winex11.drv/opengl.c
index 94739bb..465f2ef 100644
--- a/dlls/winex11.drv/opengl.c
+++ b/dlls/winex11.drv/opengl.c
@@ -244,6 +244,10 @@ static BOOL  (*pglXReleaseTexImageARB)(D
 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)
@@ -2589,6 +2597,32 @@ static BOOL WINAPI X11DRV_wglSwapInterva
 }
 
 /**
+ * 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)
  *
  * Check if the supported GLX version matches requiredVersion.
@@ -2709,6 +2743,14 @@ static const WineGLExtension WGL_EXT_swa
   }
 };
 
+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
 
     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);
 }
 
 




More information about the wine-cvs mailing list