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.