PDA

View Full Version : glGenTextures and EXC_BAD_ACCESS


BobbyWatson
2002.08.31, 05:23 PM
I've been working with textures in an OpenGL program for the last few days, but the program will always crash at the glGenTextures() call. Here's some parts of the program :

//global variables
GLuint textures[5];

//later in the program, after loading 5 32x32 bits textures in
//unsigned char* buffers using Quicktime

glGenTextures(5, &textures[0]);

At this line, the program will crash with a EXC_BAD_ACCESS signal if I run it through the debugger. In regular running mode, the app quits with a "signal 10 (SIGBUS)" message.

I'm using a 300Mhz iBook, running Mac OS X 10.1.5 and ProjectBuilder 1.1.5. OpenGL is not supported for my computer, I know, but the program actually runs (probably using some sort of software emulation or whatever). At least it ran before I tried to add textures to it.

Does anyone have an idea of what I've done wrong? If you need more info, please ask.

Mathieu Lesperance (aka BobbyWatson)

BobbyWatson
2002.08.31, 05:48 PM
Forget this message, I just solved it : I needed a valid OpenGL context before calling any GL function. Sorry about that.