glGetIntegerv / glGetFloatv Android NDK

Put problems with the Android NDK in this forum.

glGetIntegerv / glGetFloatv Android NDK

Postby MomTarsh » Thu Mar 24, 2011 3:00 pm

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:

Code: Select all
    m_camera.SetViewMatrix(); //just to make sure nothings left from the last render

        int viewport[4];
        glGetIntegerv(GL_VIEWPORT, viewport);

        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);

Everything looks ok, but it seems like the glGet* functions are simply not working, and are not returning any values.

I have even tried initialising the variables to certain values, but when the glGet* functions are called, the variables are unchanged. For example:

Code: Select all
int viewport[4];
viewport[0] = 1;
viewport[1] = 2;
viewport[2] = 3;
viewport[3] = 4;

and when glGetIntegerv(GL_VIEWPORT, viewport); is called, viewport is still the same. The same applies to all the variables.

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.
Yes, I have set the viewport using glViewport and set the Projection and View matrices

Thanks! :D
Once Poster
Once Poster
Posts: 1
Joined: Thu Mar 24, 2011 2:57 pm


Return to NDK Problems

Who is online

Users browsing this forum: No registered users and 2 guests