Re: Still SgOglCreateColorChooser problem

New Message Reply Date view Thread view Subject view Author view

Glenn Waldron (gwaldron++at++peril.com)
Thu, 14 Aug 1997 19:45:59 -0400


brainval wrote:
>
> Hi:
>
> Thanks for all the answers, but:
>
> When using the SgOglCreateColorChooser() widget the programs also
> crashes.
[...]

I had a similar problem using the Viewkit VkColorChooserDialog
object, which in turn uses the SgColorChooser widget. Under
Performer 2.0, Performer would lose its GLX graphics context
after the widget was instantiated.

This fix worked for me; this code is in the pre-draw pfChannel
callback, and it saves the original context/drawable, and
then restores it every frame: (Opengl only)

  static int first = TRUE;
  static Display* xdisplay;
  static GLXContext context;
  static GLXDrawable drawable;

  if (first)
    {
      first = FALSE;
      xdisplay = pfGetCurWSConnection();
      context = glXGetCurrentContext();
      drawable = glXGetCurrentDrawable();
    }
  else
    {
      glXMakeCurrent(xdisplay, drawable, context);
    }

hope this helps.. note, things work fine under pf2.2 beta without
this fix; I guess they fixed something.. enjoy, glenn

-- 
Glenn Waldron * Peril Technologies * voice/page: 703.598.7835 
mailto:gwaldron++at++peril.com * http://www.peril.com
=======================================================================
List Archives, FAQ, FTP:  http://www.sgi.com/Technology/Performer/
            Submissions:  info-performer++at++sgi.com
        Admin. requests:  info-performer-request++at++sgi.com

New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:55:44 PDT

This message has been cleansed for anti-spam protection. Replace '++at++' in any mail addresses with the '@' symbol.