Why does calling glMatrixMode(GL_PROJECTION) give me EXC_BAD_ACCESS in an iPhone app?
- by MrDatabase
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.