[Plib-devel] glIsValidContext
Brought to you by:
sjbaker
From: Bram S. <br...@sa...> - 2004-12-31 06:44:15
|
Steve Baker wrote: > So - the problem is that if we leave out the glIsValidContext check > then programmers make this VERY common mistake - and don't notice it > for months or years later - and blame it on us. > > If we leave the glIsValidContext check in, then we sometimes fail > on broken OpenGL implementations. > > I prefer to leave the check in there and try to get OpenGL fixed > wherever possible. I would record the creation of a context in plib, and do your context check as follows: bool check_context() { if (opengl thinks context is ok) return true; if (plib has not yet created context) WARNING: you should not use opengl without context. Fix your app. return false; WARNING: You are using a broken OGL implementation. Demand better drivers. return true; } Of course, the last warning, you want to print only once, and not every time the context is checked for validity. Bram |