Android Color Buffer problem!!

Hi all,

I’m creating an application type finger paint in Android, but a bit more complex. I found many examples on this topic, but the techniques used are rather slow. I simply used a technique very fast. The technique consists in not erase the color buffer, so that each touch drawn is accumulated in the color buffer, without having the need to reshape it after each rendering:


public void onDrawFrame(GL10 gl) {
    // gl.glClear(GL10.GL_COLOR_BUFFER_BIT); <-- no
    ....
}

Unfortunately, on some devices work properly, while others dispositivii the image is erased at the first touch, or the picture is divided into 4 portions. I want to know if the color buffer in OpenGL is treated differently by the various devices? Will disappear? Or this is a wrong technique? Or you need to set something?

thanks

It is a wrong technique. You cannot simply reuse the color buffer of previous frames directly. Have you considered double buffering? Not to mention that the behavior of the default framebuffer is defined by the windowing system, thus unless you explicitly request e.g. a single buffered context or you explicitly request a double buffered context and handle it accordingly, you’ll not get a portable solution.

thanks for the reply. I do not have much experience with opengl. I wanted to ask if there is a way to define a custom framebuffer? To handle it in my own way? I want to use the VBO, but I do not know if this is the solution, or has nothing to do