Before you do all the work, take a look these classes bundled in the OpenGL session of the APIDemos of the samples in the Anroid SDK:
MatrixTrackingGL.java. In your SDK or online: http://code.google.com/p/apps-for-android/source/browse/trunk/Samples/OpenGLES/SpriteText/src/com/google/android/opengles/spritetext/MatrixTrackingGL.java?r=35 MatrixGrabber.java. In your SDK or online: http://code.google.com/p/apps-for-android/source/browse/trunk/Samples/OpenGLES/SpriteText/src/com/google/android/opengles/spritetext/MatrixGrabber.java?r=35 On Mar 25, 4:33 am, tcassany <tcass...@betomorrow.com> wrote: > I will write a wrapper as you explain. It's not very beautifull but > it's the only solution that I see now. > > Thank you. > > Thomas > > On Mar 24, 8:31 am, Anton <socialhac...@gmail.com> wrote: > > > > > Thomas, I just tested this using the glGetIntegerv method that > > takes an int array instead of a Buffer. It also returned 0 for me. > > So I dug into the source and found that the implementation of > > glGetIntegerv doesn't have a case for GL_MATRIX_MODE. And it sets the > > GL error to GL_INVALID_ENUM (1280). And sure enough, 1280 is returned > > by a call to glGetError right after the call to glGetIntegerv. So it > > looks like you can't get the GL_MATRIX_MODE that way on Android. > > > And upon further looking through the code I don't see anywhere > > that the matrixMode state variable is accessed. So I doubt that > > you'll have any luck getting it from the java API. > > > If you control all of your OpenGL code you can work around this by > > using a wrapper to change GL state. It's not ideal, but it should > > work. That wrapper class could then be queried for the current matrix > > mode. > > > -Anton > > > On Mar 23, 7:39 am, tcassany <tcass...@betomorrow.com> wrote: > > > > Hello, > > > > I just would to know how can I get the currentmatrixmode. I try whit > > > this : > > > > ByteBuffer buffer = ByteBuffer.allocate(4); > > > buffer.order(ByteOrder.nativeOrder()); > > > IntBuffer matrixMode = buffer.asIntBuffer(); > > > gl.glGetIntegerv(GL11.GL_MATRIX_MODE, matrixMode); > > > > ...... > > > > gl.glMatrixMode(matrixMode.get(0)) > > > > But it's alway return 0 instead of GL_MODELVIEW(5888) in my case. > > > > Thanks, > > > > Thomas- Hide quoted text - > > - Show quoted text - --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---