summaryrefslogtreecommitdiffstats
path: root/graphics/mesa-demos/files/patch-progs-xdemos-yuvrect_client.c
diff options
context:
space:
mode:
Diffstat (limited to 'graphics/mesa-demos/files/patch-progs-xdemos-yuvrect_client.c')
-rw-r--r--graphics/mesa-demos/files/patch-progs-xdemos-yuvrect_client.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/graphics/mesa-demos/files/patch-progs-xdemos-yuvrect_client.c b/graphics/mesa-demos/files/patch-progs-xdemos-yuvrect_client.c
new file mode 100644
index 0000000..1dbf8e3
--- /dev/null
+++ b/graphics/mesa-demos/files/patch-progs-xdemos-yuvrect_client.c
@@ -0,0 +1,28 @@
+--- progs/xdemos/yuvrect_client.c.orig Fri Apr 6 22:42:30 2007
++++ progs/xdemos/yuvrect_client.c Fri Apr 6 22:48:05 2007
+@@ -140,7 +140,11 @@
+ exit(0);
+ }
+
+- glx_memory = glXAllocateMemoryMESA(dpy, screen, ImgWidth * ImgHeight * 2, 0, 0 ,0);
++ #ifdef WITH_NVIDIA_GL
++ glx_memory = glXAllocateMemoryNV(ImgWidth * ImgHeight * 2, 0, 0 ,0);
++ #else
++ glx_memory = glXAllocateMemoryMESA(dpy, screen, ImgWidth * ImgHeight * 2, 0, 0 ,0);
++ #endif
+ if (!glx_memory)
+ {
+ fprintf(stderr,"Failed to allocate MESA memory\n");
+@@ -317,7 +321,11 @@
+ glXSwapBuffers(dpy, win);
+ event_loop(dpy, win);
+
+- glXFreeMemoryMESA(dpy, DefaultScreen(dpy), glx_memory);
++ #ifdef WITH_NVIDIA_GL
++ glXFreeMemoryNV(glx_memory);
++ #else
++ glXFreeMemoryMESA(dpy, DefaultScreen(dpy), glx_memory);
++ #endif
+ glXDestroyContext(dpy, ctx);
+ XDestroyWindow(dpy, win);
+ XCloseDisplay(dpy);