Languages

Menu
Sites
Language
glGet* Support on Tizen

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
Edited by: Brock Boland on 17 Mar, 2014 Reason: Paragraph tags added automatically from tizen_format_fix module.

Responses

2 Replies
muditha murthy
I have tested your sample code in my sample app and i am able to get the correct results. May be chcek once in latest 2.2.0 version. If same issue occurs may be sharing your code helps someone to find the issue, because from the above code snippet everything works fine.
Stefano Zanetti
Hi Thanks this is actually useful information. It shows the the Tizen library should support the feature. So it must be something related to my code, maybe the way I initialized OpenGL. At the moment I'm using the build in PlayerGL class. I'm already on 2.2.0 on both the SDK and the Device (I flash it last week). I'll continue my investigation starting from this perspective