Renderer spawning threads?!

Problems with Canvas, OpenGL, etc...

Renderer spawning threads?!

Postby cloudjubei » Sun Mar 27, 2011 1:40 am

Hi guys,

Basically I have this problem where my renderer thread spawns of new gameThreads (logic thread).
So in my code for the renderer I have this:

public void onSurfaceCreated(GL10 gl, EGLConfig config) {
....
gameView.surfaceReady(textureSquares);
}

so we tell the gameView that the surface was created at the end right?
The gameView is just my class that extends GLSurfaceView.

Now in the gameView i have this:

public void surfaceReady(TextureSquares squares) {
gameThread.setTextureSquares(squares);
gameThread.start();
}

which basically passes on graphic references to the thread, and then starts it off.

Now when I run the debugger on this, every so often the renderer spawns off a new gameThread (as in I can see that there's two threads (sometimes 3) that are doing the same thing), can someone explain why this is happening?
I thought that maybe it's due to my renderer not actually drawing anything, which is weird as well... as in I put breakpoints in the drawFrame method, and it does it like 3/4 times and after that the gameThread gets created, but nothing gets drawn on screen?
Help please :)
cloudjubei
Freshman
Freshman
 
Posts: 8
Joined: Wed Feb 23, 2011 3:50 pm

Top

Return to Android 2D/3D Graphics - OpenGL Problems

Who is online

Users browsing this forum: Exabot [Bot] and 2 guests