GLSurfaceView.queueEvent does not execute in the GL thread

前端 未结 1 1507
花落未央
花落未央 2021-02-14 18:39

I\'m trying to execute some OpenGL commands for my GLSurfaceView from my main activity. As the OpenGL renderer works in its own thread, I have to use queueEvent, as

相关标签:
1条回答
  • 2021-02-14 19:34

    It did some experimenting and it seems that in some cases queueEvent will execute the Runnable before onSurfaceCreated is actually called, though still on the GL thread. This can happen if you are using queueEvent immediately after onResume in the Activity.

    I did the experiment with glClearColor and even though it called the command without any exceptions, the background had not changed. Maybe the GLContext is still not properly available and the commands do nothing.

    Hope this helps!

    0 讨论(0)
提交回复
热议问题