glGenTextures and EXC_BAD_ACCESS

BobbyWatson
Unregistered
 
Post: #1
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)
Quote this message in a reply
BobbyWatson
Unregistered
 
Post: #2
Forget this message, I just solved it : I needed a valid OpenGL context before calling any GL function. Sorry about that.
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Pointer Warning in glGenTextures Pixelated 1 2,460 Apr 6, 2008 01:28 PM
Last Post: OneSadCookie
  EXC_BAD_ACCESS with gluBuild2DMipmaps Marjock 3 3,307 Aug 5, 2007 01:38 AM
Last Post: Marjock
  glGenTextures() dies from EXC_BAD_ACCES? O.o wyrmmage 8 4,552 Apr 7, 2007 07:23 PM
Last Post: wyrmmage
  OpenAL, Ogg/Vorbis music, and EXC_BAD_ACCESS 0ctane 10 7,029 May 28, 2006 01:43 PM
Last Post: OneSadCookie
  open AL crash with EXC_BAD_ACCESS carlo 9 4,035 Apr 12, 2006 09:23 PM
Last Post: Sabrina