Hello everyone,
I am currently porting a game using the NDK. I am using native OpenGL, and am having problems using the glGet* functions.
Here is a code snippet:
Everything looks ok, but it seems like the glGet* functions are simply not working, and are not returning any values.Code:m_camera.SetViewMatrix(); //just to make sure nothings left from the last render int viewport[4];//[4]; glGetIntegerv(GL_VIEWPORT, viewport); int errCode = glGetError(); float proj[16]; glGetFloatv(GL_PROJECTION_MATRIX, proj); float model[16]; glGetFloatv(GL_MODELVIEW_MATRIX, model); m_currentRay.Create(x, y, 0.0f, 1.0f, model, proj, viewport);
I have even tried initialising the variables to certain values, but when the glGet* functions are called, the variables are unchanged. For example:
and when glGetIntegerv(GL_VIEWPORT, viewport); is called, viewport is still the same. The same applies to all the variables.Code:int viewport[4]; viewport[0] = 1; viewport[1] = 2; viewport[2] = 3; viewport[3] = 4;
A few notes:
- I am debugging on a HTC Wildfire
- Using GLES 1.0
- Android SDK version 2.2 (API version 8)
Any help would be appreciated.
Thanks!![]()
Bookmarks