List of usage examples for com.badlogic.gdx.graphics GL10 GL_DITHER
int GL_DITHER
To view the source code for com.badlogic.gdx.graphics GL10 GL_DITHER.
Click Source Link
From source file:com.badlogic.gdx.physics.bullet.demo.screens.SimulationScreen.java
@Override public final void render(float graphicsDelta) { // Physics//from w w w . j a v a2 s. co m hookRenderPrePhysics(graphicsDelta); final float physicsDelta = stepPhysics(); hookRenderPostPhysics(graphicsDelta, physicsDelta); // Clear frame and enable model styles Gdx.gl10.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT); hookRenderPostClear(graphicsDelta, physicsDelta); // Apply perspective player camera perspectiveCamera.apply(Gdx.gl10); Gdx.gl10.glEnable(GL10.GL_DITHER); Gdx.gl10.glEnable(GL10.GL_DEPTH_TEST); Gdx.gl10.glEnable(GL10.GL_CULL_FACE); Gdx.gl10.glEnable(GL10.GL_BLEND); Gdx.gl10.glBlendFunc(GL10.GL_SRC_ALPHA, GL10.GL_ONE_MINUS_SRC_ALPHA); // Position lights so lighting calculations for objects are correct positionLights(graphicsDelta, physicsDelta); renderDynamicsWorld(); hookRenderScene(graphicsDelta, physicsDelta); // Apply orthographic OSD camera osdCamera.apply(Gdx.gl10); // Disable face culling so we draw everything Gdx.gl10.glDisable(GL10.GL_CULL_FACE); // Render OSD disableLights(); osdSpriteBatch.begin(); osdFont.setColor(1, 1, 1, 1f); osdFont.draw(osdSpriteBatch, getOSDText(), 10, 10 + osdFont.getCapHeight()); osdSpriteBatch.end(); hookRenderOSD(graphicsDelta, physicsDelta); }
From source file:com.davidykay.shootout.Renderer.java
License:Apache License
public void render(Application app, Simulation simulation) { GL10 gl = app.getGraphics().getGL10(); gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT); gl.glViewport(0, 0, app.getGraphics().getWidth(), app.getGraphics().getHeight()); renderBackground(gl);/*from w w w . j a v a 2 s .c o m*/ renderEarth(gl); gl.glDisable(GL10.GL_DITHER); gl.glEnable(GL10.GL_DEPTH_TEST); gl.glEnable(GL10.GL_CULL_FACE); //setProjectionAndCamera(app.getGraphics(), simulation.ship, app); setProjectionAndCameraAugmentedReality(app.getGraphics(), simulation, app); setLighting(gl); gl.glEnable(GL10.GL_TEXTURE_2D); renderMoon(gl, simulation.ship); renderShip(gl, simulation.ship, app); renderAliens(gl, simulation.aliens); gl.glDisable(GL10.GL_TEXTURE_2D); renderBlocks(gl, simulation.blocks); gl.glDisable(GL10.GL_LIGHTING); //renderShots(gl, simulation.shots); //renderRays(gl, simulation.mRays, true); renderAlienRays(gl, simulation.mAlienRays); renderPlayerRays(gl, simulation.mShipRays); gl.glEnable(GL10.GL_TEXTURE_2D); renderExplosions(gl, simulation.explosions); renderBombExplosions(gl, simulation.bombExplosions); gl.glDisable(GL10.GL_CULL_FACE); gl.glDisable(GL10.GL_DEPTH_TEST); spriteBatch.setProjectionMatrix(viewMatrix); spriteBatch.setTransformMatrix(transformMatrix); spriteBatch.begin(); if (simulation.ship.lives != lastLives || simulation.score != lastScore || simulation.wave != lastWave) { status = "lives: " + simulation.ship.lives + " wave: " + simulation.wave + " score: " + simulation.score; lastLives = simulation.ship.lives; lastScore = simulation.score; lastWave = simulation.wave; } spriteBatch.enableBlending(); spriteBatch.setBlendFunction(GL10.GL_ONE, GL10.GL_ONE_MINUS_SRC_ALPHA); font.draw(spriteBatch, status, 0, 320); spriteBatch.end(); alienAngle += app.getGraphics().getDeltaTime() * 90; if (alienAngle > 360) alienAngle -= 360; }
From source file:com.digitale.mygdxgame.Renderer.java
License:Open Source License
private void renderSolarSystem(Application app, Simulation simulation) { GL10 gl = app.getGraphics().getGL10(); gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT); gl.glViewport(0, 0, app.getGraphics().getWidth(), app.getGraphics().getHeight()); // renderBackground(gl); gl.glDisable(GL10.GL_DITHER); gl.glEnable(GL10.GL_DEPTH_TEST);//from w ww .j a v a2s . co m gl.glEnable(GL10.GL_CULL_FACE); setProjectionAndCamera(app.getGraphics(), Simulation.ship, app, gl); setLighting(gl); gl.glEnable(GL10.GL_TEXTURE_2D); // renderRoids(gl); // camera.unproject(GameLoop.touchPoint.set(Gdx.input.getX(), // Gdx.input.getY(), 0)); // render earth // renderPlanet(gl, "earth", true, 63780f, 200000, 0, 50000); // render mars renderPlanet(gl, "sun", true, 33970, 0, 0, 50000); // render sun renderSun(gl, 69550f, 0, 0, -500000, app); // render jupiter // renderPlanet(gl, "earth", false, 714920f, -4000000, 0, 50000); // render moon // renderMoon(gl, 17370f, 100000, 0, -50000); // renderDrones(gl, simulation.drones, app, Simulation.ship); renderSky(gl, Simulation.ship, app); renderActors(gl); // do alpha models after this // render station renderStation(gl, "station01", true, 1000f, 0, 0, 0); // render myship renderShip(gl, Simulation.ship, Stardust3d.myCharacter.getShipname()); renderDusts(gl, Simulation.dusts); renderShots(gl, simulation.shots); renderMissiles(gl, simulation.missiles); // renderTrails(gl, simulation.trails); gl.glDisable(GL10.GL_TEXTURE_2D); // renderBlocks(gl, simulation.blocks); // gl.glDisable(GL10.GL_LIGHTING); gl.glEnable(GL10.GL_TEXTURE_2D); renderExplosions(gl, Simulation.explosions); renderHud(simulation, gl); stationAngle += app.getGraphics().getDeltaTime() * 1; if (stationAngle > 360) stationAngle -= 360; invaderAngle += app.getGraphics().getDeltaTime() * 10; if (invaderAngle > 360) invaderAngle -= 360; }
From source file:com.digitale.mygdxgame.Renderer.java
License:Open Source License
private void renderInsideStation(Application app, Simulation simulation) { GL10 gl = app.getGraphics().getGL10(); gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT); gl.glViewport(0, 0, app.getGraphics().getWidth(), app.getGraphics().getHeight()); gl.glDisable(GL10.GL_DITHER); gl.glEnable(GL10.GL_DEPTH_TEST);/*from w ww. ja va 2 s . co m*/ setStaticProjectionAndCamera(app.getGraphics(), app, gl); setLighting(gl); gl.glEnable(GL10.GL_TEXTURE_2D); renderStaticShip(gl, Simulation.ship, app, Stardust3d.myCharacter.getShipname()); // renderDrones(gl, simulation.drones, app, Simulation.ship); gl.glDisable(GL10.GL_DITHER); gl.glEnable(GL10.GL_TEXTURE_2D); // do alpha models after this renderHangar(gl, Simulation.ship, app); gl.glDisable(GL10.GL_TEXTURE_2D); renderHud(simulation, gl); }
From source file:com.digitale.mygdxgame.SplashRenderer.java
License:Open Source License
private void renderInsideStation(Application app) { GL10 gl = app.getGraphics().getGL10(); gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT); gl.glViewport(0, 0, app.getGraphics().getWidth(), app.getGraphics().getHeight()); gl.glEnable(GL10.GL_BLEND);/*ww w .j av a 2 s. c o m*/ gl.glDisable(GL10.GL_DITHER); gl.glEnable(GL10.GL_DEPTH_TEST); gl.glEnable(GL10.GL_CULL_FACE); setStaticProjectionAndCamera(app.getGraphics(), app, gl); setLighting(gl); gl.glEnable(GL10.GL_TEXTURE_2D); renderSky(gl); renderPlanet(gl, "sun", true, 1737f, Splash.planetmove - 150, 0, -2500, app); renderSky(gl); gl.glDisable(GL10.GL_DITHER); gl.glDisable(GL10.GL_CULL_FACE); //do alpha models after this renderStaticShip(gl, app); renderSun(gl, 70000f, -1600, 0, -4500, app); gl.glDisable(GL10.GL_TEXTURE_2D); renderHud(gl); }
From source file:se.claremont.android.wallpaper.ClaremontWallpaper.java
License:Apache License
@Override public void render() { ////from w w w .j a v a 2s . co m // Set GL state // GL10 gl = Gdx.graphics.getGL10(); gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT); gl.glViewport(0, 0, Gdx.graphics.getWidth(), Gdx.graphics.getHeight()); gl.glDisable(GL10.GL_DITHER); gl.glEnable(GL10.GL_DEPTH_TEST); gl.glEnable(GL10.GL_CULL_FACE); gl.glEnable(GL10.GL_COLOR_MATERIAL); gl.glHint(GL10.GL_POLYGON_SMOOTH_HINT, GL10.GL_NICEST); gl.glEnable(GL10.GL_LIGHTING); gl.glEnable(GL10.GL_LIGHT0); // // Update light position // lightPosition.put(0, perspectiveCamera.position.x); lightPosition.put(1, perspectiveCamera.position.y); lightPosition.put(2, perspectiveCamera.position.z); gl.glLightfv(GL10.GL_LIGHT0, GL10.GL_POSITION, lightPosition); // // Update camera position/direction // perspectiveCamera.position.set(perspectiveCameraCurrentPosition); perspectiveCamera.direction.set(perspectiveCameraCurrentDirection); perspectiveCamera.position.rotate(Gdx.graphics.getDeltaTime(), 0f, 1f, 0f); perspectiveCamera.direction.rotate(Gdx.graphics.getDeltaTime(), 0f, 1f, 0f); perspectiveCameraCurrentPosition = perspectiveCamera.position; perspectiveCameraCurrentDirection = perspectiveCamera.direction; perspectiveCamera.update(); perspectiveCamera.apply(gl); // // Render Claremont text model // gl.glPushMatrix(); gl.glColor4f(1f, 1f, 1f, 1f); gl.glRotatef(0.25f, 1f, 0f, 0f); claremontText.render(GL10.GL_TRIANGLES); gl.glPopMatrix(); // // Render Claremont orb model // gl.glPushMatrix(); gl.glColor4f(0.36862745f, 0.63921569f, 0.82352941f, 1f); gl.glRotatef(0.25f, 1f, 0f, 0f); claremontOrb.render(GL10.GL_TRIANGLES); gl.glPopMatrix(); }