0.6.2: OpenGLRenderer: glInterleavedArrays
Posted: Mon Sep 14, 2009 23:21
Hey CE I ran into a peculiar issue today using v0.6.2 and glInterleavedArrays. I'm not sure if this is relevant to v0.7.0 but I thought I would share this anyway.
Basically I was getting an access violation inside nvidia's opengl driver when calling glInterleavedArrays from CEGUI's OpenGL renderer. The odd thing is that I know this has worked in the past and it was working on another machine with the same hw, sw, and drivers. The other odd thing is that it worked if I attached the vc debugger to the app before the error occured. WTF?
Anyway, I looked into this and noticed that glInterleavedArrays has been 'unofficially' deprecated for awhile. So I tried using the gl*Pointer functions instead and this has fixed the problem. This is the patch I used:
I think it is also worth noting that OpenGL 3.0 has officially deprecated all of these, among many others. Are you planning on addressing that in the OpenGL renderer in 0.7.x?
Basically I was getting an access violation inside nvidia's opengl driver when calling glInterleavedArrays from CEGUI's OpenGL renderer. The odd thing is that I know this has worked in the past and it was working on another machine with the same hw, sw, and drivers. The other odd thing is that it worked if I attached the vc debugger to the app before the error occured. WTF?
Anyway, I looked into this and noticed that glInterleavedArrays has been 'unofficially' deprecated for awhile. So I tried using the gl*Pointer functions instead and this has fixed the problem. This is the patch I used:
Code: Select all
--- a/CEGUI/RendererModules/OpenGLGUIRenderer/openglrenderer.cpp
+++ b/CEGUI/RendererModules/OpenGLGUIRenderer/openglrenderer.cpp
@@ -212,7 +212,16 @@
d_currTexture = 0;
initPerFrameStates();
- glInterleavedArrays(GL_T2F_C4UB_V3F , 0, myBuff);
+ //glInterleavedArrays(GL_T2F_C4UB_V3F , 0, myBuff);
+
+ // this fixes an access violation exception on some video cards caused by
+ // glInterleavedArrays; i am assuming because that function is deprecated.
+ glEnableClientState(GL_TEXTURE_COORD_ARRAY);
+ glEnableClientState(GL_COLOR_ARRAY);
+ glEnableClientState(GL_VERTEX_ARRAY);
+ glTexCoordPointer(2, GL_FLOAT, sizeof(MyQuad), &myBuff[0].tex);
+ glColorPointer(4, GL_UNSIGNED_BYTE, sizeof(MyQuad), &myBuff[0].color);
+ glVertexPointer(3, GL_FLOAT, sizeof(MyQuad), &myBuff[0].vertex);
// iterate over each quad in the list
for (QuadList::iterator i = d_quadlist.begin(); i != d_quadlist.end(); ++i)
I think it is also worth noting that OpenGL 3.0 has officially deprecated all of these, among many others. Are you planning on addressing that in the OpenGL renderer in 0.7.x?