View Full Version : OpenGL works on Vista, but not Mac 10.5

14th October 2009, 17:39

Subject line says it all--in particular, I get

1) sigsev when executing 'glGetBooleanv(GL_STEREO, &b);',
2) Null pointer returned from gluNewQuadric(), and
3) Incredibly slow texture processing, and incorrect mapping (the texture is rendered 10x the actual size).

My program works with only a few tiny glitches (the occasional 'makeCurrent() failed'--I'm rendering from a worker thread) under Vista, with an nVidia GTS 250. I developed this under Vista, and it compiles fine on my Mac Pro (OSX 10.5, ATI Radeon X1900) aside from some debugging symbol warnings in the Qt modules. All of the Qt opengl demos work great on the Mac. My includes are

#include <QGLWidget>
#include <qgl.h> //"No such file or directory" for #include <QGL>
#include <QtOpenGL>
#ifdef Q_WS_WIN
#include "GL/glext.h"
#ifdef Q_WS_MAC
#include <Glut/glut.h>

I looked at some of the opengl example code and I didn't see anything I was missing. Anybody know what might be going on here? Thank you!


15th October 2009, 16:14
If you do anything regarding OpenGL outside of paintGL, intializeGL or resizeGL, make sure to call QWidget::makeCurrent() before.

15th October 2009, 16:24
Hi Axel,

I do. If I don't, then the program won't run in Vista either. As it is it *does* work in Vista, aside from getting a few 'makeCurrent() failed' error messages generating within paintGL(). These occur when I first open the gl context, but not thereafter--whereas the errors I described in at least 1) and 3) have are not related to the creation of the gl context.

Take 1) for example--the debugger indicates that that line causes a segmentation fault within glGetBooleanv (it's top line of the debugger output). This happens when I start the program, before I have created any qgl obects. I take it this means something isn't loarded or linked properly?


15th October 2009, 16:33
Do opengl-examples of Qt work on your machine? If yes, what happens when you add that glGetBooleanv there?

15th October 2009, 16:59

Yes, all opengl examples work. When I put the glGetBooleanv call into HelloGL, it *works* (i.e. no segmentation fault). (Good suggestion.) But everything included in HelloGL is also included in my program. My code is far too big to even think about posting so I guess I have a stretch of debugging ahead of me... but I would love to know if you have any idea as to how something like this could come about. Something working on Vista but not on Mac is *not* the normal way of things. :)