[Ti.OpenGL] Possible bug in glGet...

You must Login before you can answer or comment on any questions.

Trying to get the glGet* functions working on the Ti.Opengl module (for picking into the 3D scene), however I am seeing odd results.

For example, using the included 'gears' demo, I am adding the following lines to the drawImage function in the files gears.js.

var viewport = view.glGetIntegerv( OpenGL.GL_VIEWPORT );
Ti.API.info(viewport.join(","));
Reading the opengl es docs on glGet (http://www.khronos.org/opengles/sdk/1.1/docs/man/glGet.xml) I would expect that the resulting array be:

1) Of length 4. According to the docs, GL_VIEWPORT is a 4 value array. 2) Consistent with each frame (unless I rotate device) as the viewport is not changing.

However this is some sample output:

[INFO] 9,9,4,24,0,0,0,0,1163873351,1162691916,1096766542,1497453138,1179992671,5391686,0,262144
[INFO] 9,9,1114374148,1113878121,1701209717,114,0,0,9,292574605,1598816258,1095715910,84,0,0,262144
[INFO] 9,9,7,12,0,0,0,0,1449086023,1347896649,5526095,0,0,0,0,0
[INFO] 9,9,4,12,0,0,0,0,1449086023,1347896649,5526095,0,0,0,0,262144
[INFO] 9,9,1349255172,1298690933,1769108577,120,0,0,292592933,9,2,3,2,292597200,0,262144
Which is neither a or b! Something very odd is going on.

Any thoughts?

— asked 2 years ago by Al James
1 Comment
  • Another example. Getting the GL_BLEND_COLOR should return an array of 3 values (R,G,B).

    var values = view.glGetIntegerv( view.GL_BLEND_COLOR );
    Ti.API.info(values.join(","));
    Example data:
    [INFO] 9
    [INFO] 9
    [INFO] 9
    [INFO] 9
    [INFO] 49613988
    [INFO] 9
    [INFO] 49613668
    [INFO] 9
    [INFO] 49613988
    [INFO] 9
    [INFO] 49613988
    [INFO] 49613668
    Clearly not right!

    — commented 2 years ago by Al James

Your Answer

Think you can help? Login to answer this question!