Why does calling glMatrixMode(GL_PROJECTION) give me EXC_BAD_ACCESS in an iPhone app?

Posted by MrDatabase on Stack Overflow See other posts from Stack Overflow or by MrDatabase
Published on 2008-11-04T00:03:12Z Indexed on 2010/05/23 19:01 UTC
Read the original article Hit count: 448

Filed under:
|

I have an iphone app where I call these three functions in appDidFinishLaunching:

glMatrixMode(GL_PROJECTION);
glOrthof(0, rect.size.width, 0, rect.size.height, -1, 1);
glMatrixMode(GL_MODELVIEW);

When stepping through with the debugger I get EXC BAD ACCESS when I execute the first line. Any ideas why this is happening?

Btw I have another application where I do the same thing and it works fine. So I've tried to duplicate everything in that app (#imports, adding OpenGLES framework, etc) but now I'm just stuck.

© Stack Overflow or respective owner

Related posts about iphone

Related posts about opengl-es