Click to See Complete Forum and Search --> : glTexture2D causes access violation in release build


rvikram
August 17th, 2005, 10:48 PM
Howdy,

I am using VC++ .NET & MFC to open perform imaging. i have child windows that use openGL to display 2D images as a texture mapped quad.

My application runs fine in debug and even in release build when started from the debugger. When i move my program to the desktop and run it, it fails. i traced it to an access violation in glTexture2D.

I tried debugging the program using gDEBugger (debugger for openGL). It works fine when launched by this one too.

i would have posted my code, but my program gets data from a DAQ board and it would be impossible for you to test it.

i checked up on the usual stuff - afx_message definitions and thread safety.

any suggestions? thanks in advance.

rvikram
August 18th, 2005, 12:07 PM
I found out what was causing the problem.... me.

I didn't initialize the texture. i was allocating a texture name but didn't use glTexture2D in the initialization routine to load data into it. The first time glTexture2D was being called was only in the display routine. In the release build glTexture2D generated an access violation (when run from outside the debugger).

I solved it by loading an empty array as a texture in the initialization part.

thanks for taking a look,
vikram