glXGetCurrentDisplay returning NULL even with appropriate visual

tom fogal tfogal at alumni.unh.edu
Fri Nov 21 19:20:00 PST 2008


Brian Paul <brian.paul at tungstengraphics.com> writes:
> tom fogal wrote:
[snip]
> > The display (`dpy' variable) passed is NULL, which seems quite
> > suspect.  Assuming that is indeed the problem, the root issue
> > appears to be a:
> > 
> >     glXQueryVersion(glXGetCurrentDisplay(), ...);
> > 
> > line, where glXGetCurrentDisplay returns NULL.
> 
> I suspect you haven't yet called glXMakeCurrent().  From the man page:

Oh, oops, sorry, I forgot to mention that I did indeed check this.

This post made me think to check the return value of glXMakeCurrent,
though it does appear to report success.

It also made me think to try calling glXGetCurrentContext in other
places.  It appears like right before I call glewInit my context is
valid / acceptable.  Then, of course, it crashes in a sub-call of
glewInit ... so I wonder if glew is doing things to invalidate my
(pre-existing) context.

Ahh, I've got something to go on now!  Thanks for the help.  I'm sure
I'll be back if that doesn't turn out to be the root cause.

Best,

-tom



More information about the xorg mailing list