I am working on a LibGDX framework that provides a shell for creating opengl calls. I regularly come across the following pairs of functions:
Gdx.gl.glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
Gdx.gl.glClear(GL10.GL_COLOR_BUFFER_BIT);
the documentation (from OpenGL) explains that glClearColor allows you to:
Specify the red, green, blue, and alpha values used to clear the color buffers.
What is the purpose of choosing a particular transparent color here when it is immediately overwritten by what it gets rendered? Should I choose a color that matches your scene? Is it used to set the background for the scene?
source
share