Hi everybody. This is my first post in the group, I hope not the last :) .
I am working in an OpenGL application, and was analyzing the GLThread code in ApiDemos in order to define the work loop in my app. I have some questions about: 1/ In the fragment: if(needToWait()) { while (needToWait()) { wait(); } } , why the if statement? I guess it could be related with some synchronization issue, but I am not able to find any scenario where it is necessary. I think that while (needToWait()) { wait() } would be enough. 2/ I think the member mContextLost is unnecesary. It is set to false in the GlThread.surfaceCreated() method, at the same time that mHasSurface is set to true. It is never set to true in all the code. It is only read at needToWait(), in a logical 'or' operation with ! mHasSurface. I think mHasSurface is enough for the job, am I losing anything? 3/ Why is mEglHelper.finish() called when mPaused is true (this is, when the onPaused() callback in the ---Activity was called)? The lifecycle of Activity specifies that onPaused() is called when the activity is not at foreground. I understand that rendering is blocked in wait() in this situation, but is it really necessary releasing the EGL objects and recover them later? 4/ The run() method explains the use of sEglSemaphore in this comment: /* * When the android framework launches a second instance of * an activity, the new instance's onCreate() method may be * called before the first instance returns from onDestroy(). * * This semaphore ensures that only one instance at a time * accesses EGL. */ EGL and GL are considered exclusive access resources? I understand than the GPU is, but what's the problem in having different EGL and GL contexts in different threads and processes? Thank you and best regards, David A. Velasco --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---