[GEM-dev] HaveValidContext + AGL

IOhannes m zmoelnig zmoelnig at iem.at
Mon Jan 30 17:14:33 CET 2006


chris clepper wrote:
> Those checks are to prevent crashes when making GL calls without a
> context.  On the Mac side the context is created with the first window
> creation so any object with GL calls in the creator method will often

well, i did not try to question the HaveValidContext as such (i imagined 
that it was pretty important, otherwise it wouldn't be there)

my first idea was to add a haveValidContext field to GemState - however, 
i think there is (currently) _always_ a valid context when the render() 
method of an object is called.

most occurences of the valid-context querying are when it comes to 
loading something (a vertex_program, a model,...): probably the best 
solution for this would be to defer the loading until the actual the 
rendering starts (which would ensure that we have a context); so the 
users don't have to worry about the right time to click on the "open" 
button.


however what remains unclear is why there is the AGL-reference alongside 
the HaveValidContext() declaration? (e.g. in Geos/imageVert.cpp)
unfortunately i wasn't able to find an AGL/agl.h reference-file on the 
web...so i don't know which magic happens in there.


> crash when loading a patch before having a window.  Jamie has done
> something which creates a context when GEM loads and removes the need
> for these checks but I don't know if it's tested and ready or not.
> 

that might be very nice

mf.asdr
IOhannes




More information about the GEM-dev mailing list