Java Code Examples for com.jogamp.opengl.GL#glClear()

The following examples show how to use com.jogamp.opengl.GL#glClear() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: OneTriangle.java    From clearvolume with GNU Lesser General Public License v3.0 5 votes vote down vote up
protected static void render(GL pGL, int width, int height)
{
	pGL.glClear(GL.GL_COLOR_BUFFER_BIT);

	// draw a triangle filling the window
	pGL.getGL2().glLoadIdentity();
	pGL.getGL2().glBegin(GL.GL_TRIANGLES);
	pGL.getGL2().glColor3f(r, 0, 0);
	pGL.getGL2().glVertex2f(0, 0);
	pGL.getGL2().glColor3f(0, g, 0);
	pGL.getGL2().glVertex2f(width, 0);
	pGL.getGL2().glColor3f(0, 0, b);
	pGL.getGL2().glVertex2f(width / 2, height);
	pGL.getGL2().glEnd();
}