[GRASS-dev] Re: nvizlib compile error

Glynn Clements glynn at gclements.plus.com
Thu Jul 10 00:17:20 EDT 2008


Michael Barton wrote:

> Are we at a place yet where I can compile and test this on a Mac,  
> given it's location of OpenGL in the agl directory?

The code won't compile on a Mac at present.

AFAICT, it requires at least:

    /* TODO */
-    rwin->displayId = aglChoosePixelFmt(GDHandle *dev, int ndev, attributeList);
+    rwin->displayId = aglChoosePixelFmt(NULL, 0, attributeList);

-    rwin->contextId = aglCreateContext(rwin->display, NULL); 
+    rwin->contextId = aglCreateContext(rwin->displayId, NULL); 

    /* create win pixmap to render to (same depth as RootWindow) */
-    rwin->pixmap = NULL; /* TODO */
+    rwin->pixmap = <no idea what should go here, but it ain't NULL>; 

There is some information on AGL at:

[1]	http://www.mesa3d.org/brianp/sig97/agl.txt
[2]	http://www.mesa3d.org/brianp/sig97/compare.htm

but I don't know how much of that refers to "classic" rather than OSX. 
There's a lot more information in visualization/nviz/src/togl.c, but
it doesn't include creating off-screen pixmaps.

I also note:

[3]	http://www.iua.upf.es/~ggeiger/redbookhtml/apc.html

	Off-screen Rendering

	To render off-screen, first create an off-screen graphics
	world in the usual way, and pass the handle into
	aglCreateAGLPixmap().

Good luck on figuring out what "the usual way" is ;)

A Google search for aglCreateAGLPixmap produces exactly 7 hits; I've
just posted three of them, and the other 4 seem to be duplicates of
[1] and [3].

IOW, everything that mentions aglCreateAGLPixmap seems to assume that
you are already familiar with normal (non-OpenGL) Mac GUI programming.

In any case, it's going to require some amount of trial and error from
someone with a Mac.

-- 
Glynn Clements <glynn at gclements.plus.com>


More information about the grass-dev mailing list