glGetIntegerv / glGetFloatv

368 views
Skip to first unread message

MomTarsh

unread,
Mar 24, 2011, 6:57:08 AM3/24/11
to android-ndk
Hello,

There seems to be a problem when I am calling either glGetIntegerv or
glGetFloatv (and probably other glGet* functions, which I do not use).

Here is my code:

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

int viewport[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);

When it runs this code, the glGet* functions don't seem to be doing
anything. I tried initialising the variables to values I would
recognise for example

viewport[0] = 1;
viewport[1] = 2;
viewport[2] = 3;
viewport[3] = 4;
glGetIntegerv(GL_VIEWPORT, viewport);

etc, but still none of the variables change. A few notes:

- I am using Android 2.2 SDK.
- I am using NDK R5
- I am debugging on a HTC Wildfire.

Any help would be appreciated.

Thanks.

Futumsh

unread,
Mar 24, 2011, 11:31:00 AM3/24/11
to android-ndk
I think the HTC Wildfire is an opengl es 1.0 device, and those glGet*
parameters were added for opengl es 1.1. If you check for errors
after the calls you should see invalid enums.

MomTarsh

unread,
Mar 24, 2011, 11:47:20 AM3/24/11
to android-ndk
Thank you for the quick reply,

Yes, when I call glGetError(), it seems to give me an odd number which
does not correspond to anything. In this case 2459720, this can
change, however. .

I'm guessing there's no way around this and I will just have to test
on a different device?

Thanks.
Reply all
Reply to author
Forward
0 new messages