I am trying to make something like a very simple drawing application using Libgdx. I have been looking for intertubes for several days trying to solve this problem, which is probably due to my openGL noobness.
When I draw an object on the screen while the render () method is working, the material that I draw flashes very quickly (I accept it every time the render () method is called). If I turn off continuous rendering, the blinking will stop until I draw something else (again, render () is not called).
Suppose I load a new texture into Sprite appropriately - it draws, scams everything - and everything I do in my render () method is this:
batch.begin();
myShape.setPosition(Gdx.input.getX(), Gdx.input.getY());
batch.setColor(Color.BLUE);
myShape.draw(batch);
batch.end();
I don’t call glClear because I don’t think (I think) I want to clear the screen from every rendering. I blindly experimented with various glEnable and glDisable for culling, blending, dithernig, etc., but nothing helped solve the problem.
What am I doing wrong in the world or just do not understand here? Am I misunderstood something?
Dave source
share