I created renderer and loader of DirectX8 retained mode on iPhone/iPod/iPad/MacOSX/Windows. DirectX8 retained mode format is scene graph style, and hierarchy so deep. So, only Android NDK OpenGLES was occurred GL error code 0x开发者_开发问答503,0x0504(command stack over flow or under flow).
Is stack capacity of android a little? Who tried to check capacity of each devices? (NexusOne, HTC03A, Droid, Xpedia, and so on.)
To query the max stack size, use glGetIntegerv with GL_MAX_MODELVIEW_STACK_DEPTH and GL_MAX_PROJECTION_STACK_DEPTH. If you push too much matrices, this will overflow.
You are underflowing the stack, that's a bug in your code. Don't pop when there is nothing in the stack.
If you find that the stack space is too little, you can make your own matrix stack by software, and this won't have the limitations of the GL ES implementation.
精彩评论