5

OpenGL (ES) & mdash; Polygons temporarily disappear when new objects are add...

 2 years ago
source link: https://www.codesd.com/item/opengl-es-polygons-temporarily-disappear-when-new-objects-are-added-to-arraylist.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

OpenGL (ES) & mdash; Polygons temporarily disappear when new objects are added to ArrayList

advertisements

In an OpenGL ES 1.x Android application, I generate a circle (from triangles) and then translate it about one hundred times to form a level. Everything works except when a certain event occurs that causes about 15 objects to be immediately added to the arraylist that stores the circles' coordinates. When this event happens 2+ times quickly, all the circles in the list disappear for about 1/5th of a second. Besides this, the circles animate smoothly.

The program runs well as a java SE app using the same synchronization techniques, and I have tried a half a dozen or so other synch techniques to no avail, so I feel the problem is the openGL implementation. Any suggestions?


So the list is being modified under your nose? It sounds like you need to do any modification to this list on the OpenGL thread. Try Activity.postOnUiThread(Runnable), where Runnable implements your own code. Possibly.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK