Re: [Plib-users] invalid OpenGL context problem
Brought to you by:
sjbaker
From: Roy W. <ro...@ce...> - 2002-01-08 17:34:33
|
>Well, if your earlier diagnosis is right (I believe you said that >glXGetCurrentContext() was returning NULL because the X server >had not yet actually created the window into which the context >would be rendered)...then waiting for a second or two might well >be enough to kludge around the race condition. > >I was thinking of something like: > > for ( int i = 0 ; i < MAX_REDHAT_KLUDGE_DELAY ; i++ ) > { > if ( glXGetCurrentContext() != NULL ) > return TRUE ; > else > { > fprintf ( stderr, "Crappy RedHat >distro...mumble,grumble,complain...\n"); > sleep ( 1 ) ; > } > } Okay then, I'll give it a try tonight. My only concern (not necessarily knowing what I'm talking about, of course) is that just sleeping might not be enough-- that we might have to call some OpenGL/glut routines to actually get things going. Also, I believe that the user code usually registers all the glut callbacks before calling puInit(), so is it possible that our callbacks might get called before PLIB has actually been initialized? If so, then when the callbacks call PLIB code, we're hosed. Then again, all this occurs before we enter into glutMainLoop(), so that's likely not a concern, is it? -Roy |