Parcourir la source

nvizlib: some mac-related fixes (off-screen rendering)

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@32068 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa il y a 17 ans
Parent
commit
48d004c2a6
1 fichiers modifiés avec 7 ajouts et 6 suppressions
  1. 7 6
      lib/nviz/render.c

+ 7 - 6
lib/nviz/render.c

@@ -103,7 +103,7 @@ int Nviz_create_render_window(struct render_window *rwin, void *display,
 #if defined(OPENGL_X11)
 #if defined(OPENGL_X11)
     rwin->displayId = XOpenDisplay((char *) display);
     rwin->displayId = XOpenDisplay((char *) display);
 #elif defined(OPENGL_AQUA)
 #elif defined(OPENGL_AQUA)
-    /* TODO */
+    /* TODO: open mac display */
 #elif defined(OPENGL_WINDOWS)
 #elif defined(OPENGL_WINDOWS)
     /* TODO */
     /* TODO */
 #endif
 #endif
@@ -121,10 +121,10 @@ int Nviz_create_render_window(struct render_window *rwin, void *display,
     rwin->contextId = glXCreateContext(rwin->displayId,
     rwin->contextId = glXCreateContext(rwin->displayId,
 				       v, NULL, GL_FALSE);
 				       v, NULL, GL_FALSE);
 #elif defined(OPENGL_AQUA)
 #elif defined(OPENGL_AQUA)
-    /* TODO */
-    rwin->displayId = aglChoosePixelFmt(GDHandle *dev, int ndev, attributeList);
+    /* TODO: dev = NULL, ndev = 0 ? */
+    rwin->displayId = aglChoosePixelFmt(NULL, 0, attributeList);
     
     
-    rwin->contextId = aglCreateContext(rwin->display, NULL); 
+    rwin->contextId = aglCreateContext(rwin->displayId, NULL); 
 #elif defined(OPENGL_WINDOWS)
 #elif defined(OPENGL_WINDOWS)
     /* TODO int ChoosePixelFormat( HDC hdc, PIXELFORMATDESCRIPTOR *pfd ) */
     /* TODO int ChoosePixelFormat( HDC hdc, PIXELFORMATDESCRIPTOR *pfd ) */
 #endif
 #endif
@@ -147,7 +147,7 @@ int Nviz_create_render_window(struct render_window *rwin, void *display,
 					v, rwin->pixmap);
 					v, rwin->pixmap);
 #elif defined(OPENGL_AQUA)
 #elif defined(OPENGL_AQUA)
     /* create win pixmap to render to (same depth as RootWindow) */
     /* create win pixmap to render to (same depth as RootWindow) */
-    rwin->pixmap = NULL; /* TODO */
+    rwin->pixmap = NULL; /* TODO: create GWorldPtr */
     /* create an off-screen AGL rendering area */
     /* create an off-screen AGL rendering area */
     rwin->windowId = aglCreateAGLPixmap(rwin->displayId,
     rwin->windowId = aglCreateAGLPixmap(rwin->displayId,
 					rwin->pixmap); 
 					rwin->pixmap); 
@@ -185,7 +185,8 @@ int Nviz_make_current_render_window(const struct render_window *rwin)
     if (rwin->contextId == aglGetCurrentContext())
     if (rwin->contextId == aglGetCurrentContext())
 	return 1;
 	return 1;
 
 
-    aglMakeCurrent(rwin->windowId, rwin->contextId);
+    /* TODO: mac_win */
+    aglMakeCurrent((AGLDrawable) mac_win, rwin->contextId);
 #elif defined(OPENGL_WINDOWS)
 #elif defined(OPENGL_WINDOWS)
     /* TODO wglMakeCurrent( HDC hdc, HGLRC hrc ) */
     /* TODO wglMakeCurrent( HDC hdc, HGLRC hrc ) */
 #endif
 #endif