Java Code Examples for com.badlogic.gdx.graphics.GL20#glClearColor()

The following examples show how to use com.badlogic.gdx.graphics.GL20#glClearColor() . 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: MainMenuScreen.java    From ashley-superjumper with Apache License 2.0 6 votes vote down vote up
public void draw () {
	GL20 gl = Gdx.gl;
	gl.glClearColor(1, 0, 0, 1);
	gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
	guiCam.update();
	game.batcher.setProjectionMatrix(guiCam.combined);

	game.batcher.disableBlending();
	game.batcher.begin();
	game.batcher.draw(Assets.backgroundRegion, 0, 0, 320, 480);
	game.batcher.end();

	game.batcher.enableBlending();
	game.batcher.begin();
	game.batcher.draw(Assets.logo, 160 - 274 / 2, 480 - 10 - 142, 274, 142);
	game.batcher.draw(Assets.mainMenu, 10, 200 - 110 / 2, 300, 110);
	game.batcher.draw(Settings.soundEnabled ? Assets.soundOn : Assets.soundOff, 0, 0, 64, 64);
	game.batcher.end();	
}
 
Example 2
Source File: GdxScreen.java    From libGDX-Path-Editor with Apache License 2.0 6 votes vote down vote up
@Override
public void present(float deltaTime) {
	GL20 gl = Gdx.graphics.getGL20();
	gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
	gl.glClearColor(0.698f, 0.698f, 0.698f, 1f);
	
	camera.update();
	bgDrawer.presentFakeBG(screenW, screenH, camera.combined);
	
	stage.act(deltaTime);
	stage.draw();
	
	bgDrawer.presentOverlayBG(screenW, screenH,
							 (int)camera.position.x, (int)camera.position.y,
							 (int)camera.viewportWidth, (int)camera.viewportHeight,
							 stage.getSpriteBatch());
	
	if (splineBuilder != null) { splineBuilder.present(camera.combined); }
}
 
Example 3
Source File: SuperJumper.java    From ashley-superjumper with Apache License 2.0 5 votes vote down vote up
@Override
public void render() {
	GL20 gl = Gdx.gl;
	gl.glClearColor(1.0f, 1.0f, 1.0f, 0.0f);
	gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
	
	super.render();
}
 
Example 4
Source File: GdxApp.java    From libGDX-Path-Editor with Apache License 2.0 5 votes vote down vote up
@Override
public void render() {
	if (uiHandler != null) { uiHandler.updateMemoryInfo(getMemoryConsumption()); }
	
	if (screen != null) {
		screen.update(Gdx.graphics.getDeltaTime());
		screen.present(Gdx.graphics.getDeltaTime());
	}
	else {
		GL20 gl = Gdx.graphics.getGL20();
		gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
		gl.glClearColor(0.698f, 0.698f, 0.698f, 1f);
	}
}