Hi Marcus,

On Mon, Aug 18, 2014 at 5:06 AM, Marcus Lindblom Sonestedt <ma...@yar.nu>
wrote:

> Hello,
>
> The loop below is at the end of OSGWIndow.cpp (around line 1650), and runs
> infintely if there is no context. In that case, GL_INVALID_OPERATION is
> returned all the time, and the loop never exits.
>
> This happens if a PassiveWindow is destroyed while there is no current
> active context.
>
> Maybe, in PassiveWindow, one should call wgl/glx GetCurrentContext, thus
> allowing hasContext() to return false?  (Or check if you get the same error
> twice in a row, but that's fixing the symptom, not the cause...)
>
>     if(testGLErrors && this->hasContext() == true)
>     {
>         GLenum glerr;
>
>         while((glerr = glGetError()) != GL_NO_ERROR)
>         {
>             FWARNING(("Window::frameExit: Caught stray OpenGL "
>                       "error %s (%#x).\n",
>                       gluErrorString(glerr),
>                       glerr));
>
> #ifndef OSG_DEBUG
>             FWARNING(("Rerun with debug-libraries to get more accurate "
>                       "information.\n"));
> #endif
>         }
>     }
>

I'm a little reluctant to add context calls, as those tend to be expensive
and/or disruptive (pipe flushing). There's not really any reason why
GetCurrentContext should be, but in practice it's hard to predict how
expensive those calls are.

While I agree that an infinite loop is very bad behavior, is there a reason
you need to call frameExit while no context is active? In other words, can
we call this a user error? ;)

Yours

  Dirk
------------------------------------------------------------------------------
_______________________________________________
Opensg-users mailing list
Opensg-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to