Re: XForms: Problems with Mesa in a glcanvas object (2nd posting)

Steve Lamont (spl@szechuan.ucsd.edu)
Wed, 27 May 98 06:52:49 PDT

# To subscribers of the xforms list from spl@szechuan.ucsd.edu (Steve Lamont) :

> > > The "glBegin" _always_ returns INVALID_OPERATION.
> > > So I never get to the real drawing part (which is actually rather simple).
>
> It already happens the FIRST time the "expose" handler is entered and
> the very first glBegin in that. So the "state" of the OpenGL engine is
> such that it _seems_ to think it cannot draw anything yet.
> I must be missing something in the initialisation part, at least, that
> is what I'm thinking.

Hm.

I hate to say "it works for me" but it works for me.

I guess my advice at this point is to try reducing the problem to the
smallest subset you possibly can and work at it from there.

Are you sure you're getting a valid GLXContext?

The Canvas Window is mapped after the glx_init and glx_activate calls
take place (see gl.c), so OpenGL should have its act together and be
ready to draw at the point the Expose event arrives, I should think.

Is GL_INVALID_OPERATION the only error in the error stack? According
to the OpenGL blue book, you should call glGetError() in a loop:

GLenum error;

while ( ( error = glGetError() ) != GL_NO_ERROR )
fprintf( stderr, "error = %d\n", error );

or some such.

If there are more errors in the stack, this might provide a better
clue as to what's broken. One thing I really hate about OpenGL is
that its diagnostic facilities are almost non-existant -- I'd would
have really appreciated some facility for producing error messages at
the point where the error actually occurs rather than having to grovel
through a stack.

spl
_________________________________________________
To unsubscribe, send the message "unsubscribe" to
xforms-request@bob.usuf2.usuhs.mil or see
http://bob.usuf2.usuhs.mil/mailserv/xforms.html
XForms Home Page: http://bragg.phys.uwm.edu/xforms
List Archive: http://bob.usuf2.usuhs.mil/mailserv/list-archives/