monnti
04-08-2011, 02:55 PM
hi,
i have a problem with the preformace of my opengl android app. The main problem is that i have to redraw many static objects. is there a way to redraw only the changing objects and not the whole screen???
i have tried this:
if(!hasInit){
gl.glClear( GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT );
backgroundRenderer.update(gl, activity, simulation);
hasInit = true;
}
gl.glEnable(GL10.GL_SCISSOR_TEST);
gl.glScissor(0, 0, 150, 150);
gl.glClear( GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT );
backgroundRenderer.update(gl, activity, simulation);
boxRenderer.update(gl, activity, simulation);
gl.glDisable(GL10.GL_SCISSOR_TEST);
but now I have weird flashing effects, except in the defined glScissor area.
i have a problem with the preformace of my opengl android app. The main problem is that i have to redraw many static objects. is there a way to redraw only the changing objects and not the whole screen???
i have tried this:
if(!hasInit){
gl.glClear( GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT );
backgroundRenderer.update(gl, activity, simulation);
hasInit = true;
}
gl.glEnable(GL10.GL_SCISSOR_TEST);
gl.glScissor(0, 0, 150, 150);
gl.glClear( GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT );
backgroundRenderer.update(gl, activity, simulation);
boxRenderer.update(gl, activity, simulation);
gl.glDisable(GL10.GL_SCISSOR_TEST);
but now I have weird flashing effects, except in the defined glScissor area.