I have a problem with Apples EAGLView and Texture2D. If I create an instance of EAGLView and draw some textures, it works fine. However, whenever I create a second instance of EAGLView, the textures are not displayed in the new view.
Being new to OpenGL, I understand exactly what causes this behavior. If someone wants to help, I created a small project that reproduces the behavior. The project can be found at http://www.cocoabeans.se/OpenGLESBug.zip
Many thanks,
Tim Andersson
Update
I tried to use groups, but I'm not sure if I used them correctly. However, this slightly changed the behavior; instead of a texture drawing only in the first instantiated representation, it now draws the texture in the last instantiated representation and draws white rectangles in other representations. I do not know if it is good or worse, but at least something appears in other views. It drives me crazy, and I would be very grateful if anyone would help me with this problem. I updated the project at http://www.cocoabeans.se/OpenGLESBug.zip to reflect the changes.
Cheers
Tim
Second update
After trying a few more things, it seems like the problem is with the Apple Texture2D class, although I'm not sure what exactly causes the behavior. I think itβs best to write your own texture class (this will help me understand how OpenGL handles textures, which is probably useful).
source share