PDA

View Full Version : QGLWIdget renderText() assertion...



adonel
21st October 2007, 19:52
Hi guys,

I have the following problem:

Whenever i try to call the renderText() function of my QGlWidget, i get an:

centaur: indirect_vertex_array.c:1359: __indirect_glTexCoordPointer: Assertion `a != ((void *)0)' failed.

error!

I am stuck up! Is this a problem with my opengl version or graphics driver??

Thank you in regards!

wysota
22nd October 2007, 07:22
Can we see the code?

adonel
22nd October 2007, 22:04
Here is a very small example of code that crashes...

void OpenGLArea::paintGL()
{
renderText(0.0, 0.0, 0.0, "Test text");
}

void OpenGLArea::resizeGL(int width, int height)
{
glViewport(0, 0, width, height);
glOrtho(-2, 2, -2, 2, -100, 100);
}

ToddAtWSU
22nd October 2007, 22:30
Please in the future put your code into Code brackets so we get syntax highlighting.

I doubt this is causing your crash, but you need to load your matrices with the viewport and ortho. You need to be in the GL_PROJECTION matrix before calling glOrtho and you need to be in the GL_MODELVIEW matrix when you call glViewport. See if getting your matrices set up correctly helps solve the problem.