Hi,
I'm working on porting some code from iOS/Android to Tizen and I noticed that my calls to glGetFloatv(GL_VIEWPORT, viewport); are retuning incorrect values. So I put together this debug code and the result are really wierd.
//Debug code
AppLog("Screen size width = %d, height = %d", GetTargetControlWidth(), GetTargetControlHeight());
glViewport(0, 0, GetTargetControlWidth(), GetTargetControlHeight());
GLenum error = glGetError();
if (error != GL_NO_ERROR)
{
AppLog("glerror for glViewpor %d", static_cast<int>(error));
}
float viewport[4];
glGetFloatv(GL_VIEWPORT, viewport);
error = glGetError();
if (error != GL_NO_ERROR)
{
AppLog("glerror for glGetFloatv %d", static_cast<int>(error));
}
AppLog("viewport 0 = %f, 1 = %f", viewport[0], viewport[1]);
AppLog("viewport 2 = %f, 3 = %f", viewport[2], viewport[3]);
int iViewport[4];
glGetIntegerv(GL_VIEWPORT, iViewport);
error = glGetError();
if (error != GL_NO_ERROR)
{
AppLog("glerror for glGetIntegerv %d", static_cast<int>(error));
}
AppLog("iViewport 0 = %d, 1 = %d", iViewport[0], iViewport[1]);
AppLog("iViewport 2 = %d, 3 = %d", iViewport[2], iViewport[3]);
The result I'm obtaining may change from run to run but generally speaking they look like this:
08-20 17:19:58.285 : INFO / Proto ( 24040 : 24040 ) : virtual bool GlRendererTemplate::InitializeGl()(63) > Screen size width = 720, height = 1280
08-20 17:19:58.285 : INFO / Proto ( 24040 : 24040 ) : virtual bool GlRendererTemplate::InitializeGl()(78) > viewport 0 = -0.417847, 1 = 0.000000
08-20 17:19:58.285 : INFO / Proto ( 24040 : 24040 ) : virtual bool GlRendererTemplate::InitializeGl()(79) > viewport 2 = 315.379395, 3 = 0.000000
08-20 17:19:58.285 : INFO / Proto ( 24040 : 24040 ) : virtual bool GlRendererTemplate::InitializeGl()(88) > iViewport 0 = 0, 1 = 720
08-20 17:19:58.285 : INFO / Proto ( 24040 : 24040 ) : virtual bool GlRendererTemplate::InitializeGl()(89) > iViewport 2 = 1280, 3 = 0
As you can see the initial values are correct. But glGetFloatv return random value and glGetIntegerv return different values which contains my coordinates but in the wrong position. There are no errors reported by glGetError().
Does anyone know if the glGet* feature is not supported on Tizen?
Also if you have any idea on how to solve the issue it would be very appreciated.
Thanks,
Stefano