[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: PLIB error while starting application



Abhir Joshi wrote:

I compiled PLIB using gcc-2.96 on RHL7.2.  Then I compiled a sample
program from the PUI programmers guide.  But when I run it, it gives
an error message as follows and quits -

FATAL: puInit called without a valid OpenGL context.
This means that you tried to use PUI without a valid OpenGL window
being opened first...however...

I even compiled plib-examples with the same error coming after running
every example.  I saw the source file pu.cxx which contains puInit().
glXGetCurrentContext() gets called while initialization takes place.
But this is returning NULL and hence the fatal error.  I dont know why
it is returning NULL since I am unaware about GLX Contexts.  Any
solutions or pointers?
There was a version of Mesa that only shipped (IIRC) with one release
of RedHat Linux that had a broken glXGetCurrentContext that returned
NULL even when there was a valid OpenGL rendering context.

I'm pretty sure that's what you have.

Is it mandatory to have hardware acceleration to run programs using
PLIB ?
No - but we really would like a working implementation of OpenGL!
An OpenGL that reports NULL for glXGetCurrentContext when you have a
valid rendering context is definitely broken!

I suggest two possiblilities:

1) Upgrade to a newer version of Mesa (that hopefully won't have that
   bug).

...or...

2) Dive into the PLIB sources and comment out the test for glXGetCurrentContext
   and the error message it produces.  If this is truly your problem,
   programs will work just fine without the test.  I believe the check
   is done in several of PLIB's xxInit functions - so you might need to
   grep the sources for all occurrances of glXGetCurrentContext.

The reason the check is in there is that many PLIB developers were
doing things like downloading texture maps without first having
a valid OpenGL window open.  Some OpenGL implementations would
(incorrectly) let you get away with that mistake - whilst others
(rightly) would error out or crash.

The problem we were getting was that people would write PLIB applications
on a 'tolerant' OpenGL implementation - then distribute the program
widely - and find that it would crash on some graphics cards and not
on others.  This was causing a lot of traffic on the PLIB mailing
list accusing PLIB of being the cause of the problem...so we implemented
the check so that broken programs would fail on ALL OpenGL implementations
and developers would find their bugs much sooner.

However, if you are not writing your own applications, you COULD just
comment out the test.

----
Steve Baker                      (817)619-2657 (Vox/Vox-Mail)
L3Com/Link Simulation & Training (817)619-2466 (Fax)
Work: sjbaker@link.com           http://www.link.com
Home: sjbaker1@airmail.net       http://www.sjbaker.org