[GRASS-SVN] r34999 - grass/trunk/lib/nviz

svn_grass at osgeo.org svn_grass at osgeo.org
Mon Dec 22 19:43:11 EST 2008


Author: kyngchaos
Date: 2008-12-22 19:43:10 -0500 (Mon, 22 Dec 2008)
New Revision: 34999

Modified:
   grass/trunk/lib/nviz/render.c
Log:
Get render.c to compile on OSX

Modified: grass/trunk/lib/nviz/render.c
===================================================================
--- grass/trunk/lib/nviz/render.c	2008-12-23 00:41:25 UTC (rev 34998)
+++ grass/trunk/lib/nviz/render.c	2008-12-23 00:43:10 UTC (rev 34999)
@@ -51,7 +51,7 @@
     rwin->pixelFmtId = NULL;
     rwin->contextId = NULL;
     rwin->pixmap = 0;
-    rwin->windowId = 0;
+    rwin->windowId = NULL;
 #elif defined(OPENGL_WINDOWS)
     rwin->displayId = NULL;
     rwin->contextId = NULL;
@@ -71,8 +71,9 @@
     glXDestroyGLXPixmap(rwin->displayId, rwin->windowId);
     XFreePixmap(rwin->displayId, rwin->pixmap);
 #elif defined(OPENGL_AQUA)
+    aglDestroyPixelFormat(rwin->pixelFmtId);
     aglDestroyContext(rwin->contextId);
-    aglDestroyAGLPixmap(rwin->windowId);
+    aglDestroyPBuffer(rwin->windowId);
     /* TODO FreePixMap */
 #elif defined(OPENGL_WINDOWS)
     wglDeleteContext(rwin->contextId);
@@ -136,14 +137,14 @@
     /* TODO: open mac display */
 
     /* TODO: dev = NULL, ndev = 0 ? */
-    rwin->pixelFmtId = aglChoosePixelFmt(NULL, 0, attributeList);
+    rwin->pixelFmtId = aglChoosePixelFormat(NULL, 0, attributeList);
 
     rwin->contextId = aglCreateContext(rwin->pixelFmtId, NULL);
 
     /* create win pixmap to render to (same depth as RootWindow) */
     rwin->pixmap = NULL;	/* TODO: create GWorldPtr */
     /* create an off-screen AGL rendering area */
-    rwin->windowId = aglCreateAGLPixmap(rwin->pixelFmtId, rwin->pixmap);
+    aglCreatePBuffer(width, height, GL_TEXTURE_2D, GL_RGBA, 0, &(rwin->windowId));
 #elif defined(OPENGL_WINDOWS)
     PIXELFORMATDESCRIPTOR pfd = {
 	sizeof(PIXELFORMATDESCRIPTOR),	//  size of this pfd 
@@ -197,11 +198,13 @@
 
     glXMakeCurrent(rwin->displayId, rwin->windowId, rwin->contextId);
 #elif defined(OPENGL_AQUA)
+    if (!rwin->contextId)
+	return 0;
+
     if (rwin->contextId == aglGetCurrentContext())
 	return 1;
 
-    /* TODO: mac_win */
-    aglMakeCurrent((AGLDrawable) mac_win, rwin->contextId);
+    aglSetCurrentContext(rwin->contextId);
 #elif defined(OPENGL_WINDOWS)
     if (!rwin->displayId || !rwin->contextId)
 	return 0;



More information about the grass-commit mailing list