[GRASS-dev] nviz python thoughts

William Kyngesburye woklist at kyngchaos.com
Sun Dec 21 00:50:14 EST 2008


On Dec 20, 2008, at 10:33 PM, Glynn Clements wrote:

> 1. It's not trying to draw into a window, but a pixmap or similar
> off-screen surface, so that the image can be saved into a file,
> without any of the crud (tooltips, mouse cursor, etc) which you might
> get from drawing to a window then grabbing it.
>
Ah, so it's not really a replacement for the togl-based interactive  
nviz.  But still renders to a window?  After poking around with stuff  
below, I wonder if this can work on OSX - I get the impression that a  
window must be attached to a Mac application somehow, not just a  
faceless CLI program.

> 3. The last record I can find of this discussion was back in July:
>
> http://www.mail-archive.com/grass-dev@lists.osgeo.org/msg04540.html
>
> Some suggestions were made, but I'm not sure if anyone actually tried
> them.
>

> 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.


1997 = pre-OSX.  The Mac window "convenience routines" mentioned are  
what we need, but are not available there and would be Classic-based  
anyways.

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

That mentions QuickDraw, which is from Classic.

Though, the Classic stuff in QuickDraw is available via Carbon API.   
This is deprecated in OSX 10.4, but still available.  Carbon is not  
64bit-enabled in OSX 10.5.  The replacement to QuickDraw is Quartz 2D,  
available starting with OSX 10.4.  So we may need to write 2 different  
versions of this.  I'd say start with Quartz 2D, then figure out  
QuickDraw later...

... oh, AGL seems to be Carbon-based.  Here's something about AGL in  
Leopard which has some references to non-carbon alternatives:

http://developer.apple.com/qa/qa2007/qa1523.html

... Some sample code from Apple - it's about using surface textures,  
but the window parts could be useful:

http://developer.apple.com/samplecode/AGLSurfaceTexture/index.html#// 
apple_ref/doc/uid/DTS10000508

There is a pbuffer example also:

http://developer.apple.com/samplecode/GLCarbon1ContextPbuffer/index.html#/ 
/apple_ref/doc/uid/DTS10003144

> 4. I still don't know what the *actual* error is.
>
I forgot I could make a subdir ;)

render.c:204: error: ‘mac_win’ undeclared (first use in this function)
render.c:204: error: (Each undeclared identifier is reported only once
render.c:204: error: for each function it appears in.)

Looks like mac_win is just a placeholder here.  For now, comment this  
line and have Nviz_make_current_render_window return 0 for OPENGL_AQUA?
>


-----
William Kyngesburye <kyngchaos*at*kyngchaos*dot*com>
http://www.kyngchaos.com/

The equator is so long, it could encircle the earth completely once.



More information about the grass-dev mailing list