本文整理汇总了Java中com.badlogic.gdx.graphics.GLCommon.glClear方法的典型用法代码示例。如果您正苦于以下问题:Java GLCommon.glClear方法的具体用法?Java GLCommon.glClear怎么用?Java GLCommon.glClear使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.badlogic.gdx.graphics.GLCommon
的用法示例。
在下文中一共展示了GLCommon.glClear方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: draw
import com.badlogic.gdx.graphics.GLCommon; //导入方法依赖的package包/类
public void draw (float deltaTime) {
GLCommon gl = Gdx.gl;
gl.glClear(GL10.GL_COLOR_BUFFER_BIT);
renderer.render();
guiCam.update();
batcher.setProjectionMatrix(guiCam.combined);
batcher.enableBlending();
batcher.begin();
switch (state) {
case GAME_READY:
presentReady();
break;
case GAME_RUNNING:
presentRunning();
break;
case GAME_PAUSED:
presentPaused();
break;
case GAME_LEVEL_END:
presentLevelEnd();
break;
case GAME_OVER:
presentGameOver();
break;
}
batcher.end();
}
示例2: draw
import com.badlogic.gdx.graphics.GLCommon; //导入方法依赖的package包/类
public void draw (float deltaTime) {
GLCommon gl = Gdx.gl;
gl.glClear(GL10.GL_COLOR_BUFFER_BIT);
guiCam.update();
batcher.setProjectionMatrix(guiCam.combined);
batcher.disableBlending();
batcher.begin();
batcher.draw(helpRegion, 0, 0, 320, 480);
batcher.end();
batcher.enableBlending();
batcher.begin();
batcher.draw(Assets.arrow, 320, 0, -64, 64);
batcher.end();
gl.glDisable(GL10.GL_BLEND);
}
示例3: draw
import com.badlogic.gdx.graphics.GLCommon; //导入方法依赖的package包/类
public void draw (float deltaTime) {
GLCommon gl = Gdx.gl;
gl.glClearColor(1, 0, 0, 1);
gl.glClear(GL10.GL_COLOR_BUFFER_BIT);
guiCam.update();
batcher.setProjectionMatrix(guiCam.combined);
batcher.disableBlending();
batcher.begin();
batcher.draw(Assets.backgroundRegion, 0, 0, 320, 480);
batcher.end();
batcher.enableBlending();
batcher.begin();
batcher.draw(Assets.logo, 160 - 274 / 2, 480 - 10 - 142, 274, 142);
batcher.draw(Assets.mainMenu, 10, 200 - 110 / 2, 300, 110);
batcher.draw(Settings.soundEnabled ? Assets.soundOn : Assets.soundOff, 0, 0, 64, 64);
batcher.end();
}
示例4: draw
import com.badlogic.gdx.graphics.GLCommon; //导入方法依赖的package包/类
public void draw (float deltaTime) {
GLCommon gl = Gdx.gl;
gl.glClear(GL10.GL_COLOR_BUFFER_BIT);
guiCam.update();
batcher.setProjectionMatrix(guiCam.combined);
batcher.disableBlending();
batcher.begin();
batcher.draw(Assets.backgroundRegion, 0, 0, 320, 480);
batcher.end();
batcher.enableBlending();
batcher.begin();
batcher.draw(Assets.highScoresRegion, 10, 360 - 16, 300, 33);
float y = 230;
for (int i = 4; i >= 0; i--) {
Assets.font.draw(batcher, highScores[i], xOffset, y);
y += Assets.font.getLineHeight();
}
batcher.draw(Assets.arrow, 0, 0, 64, 64);
batcher.end();
}
示例5: renderGL2
import com.badlogic.gdx.graphics.GLCommon; //导入方法依赖的package包/类
@Override
public void renderGL2(float gameTime)
{
GLCommon gl = Gdx.gl;
gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT);
SpriteBatch batch = getSpriteBatch();
viewMatrix.setToOrtho2D(0, 0, Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
batch.setProjectionMatrix(viewMatrix);
batch.begin();
batch.disableBlending();
batch.setColor(Color.WHITE);
//begin render background
renderBackground(gameTime);
batch.enableBlending();
batch.end();
gl.glEnable(GL10.GL_DEPTH_TEST);
gl.glEnable(GL10.GL_CULL_FACE);
camera.update();
for(IDrawable3D obj : collection)
if(obj.isVisible())
{
obj.renderGL2(gameTime);
}
gl.glDisable(GL10.GL_CULL_FACE);
gl.glDisable(GL10.GL_DEPTH_TEST);
batch.setProjectionMatrix(viewMatrix);
batch.begin();
//begin render foreground
renderForeground(gameTime);
//batch.enableBlending();
//batch.setBlendFunction(GL10.GL_ONE, GL10.GL_ONE_MINUS_SRC_ALPHA);
batch.end();
}
示例6: draw
import com.badlogic.gdx.graphics.GLCommon; //导入方法依赖的package包/类
public void draw () {
GLCommon gl = Gdx.gl;
gl.glClear(GL10.GL_COLOR_BUFFER_BIT);
renderer.render();
guiCam.update();
batcher.setProjectionMatrix(guiCam.combined);
batcher.enableBlending();
batcher.begin();
switch (state) {
case GAME_READY:
presentReady();
break;
case GAME_RUNNING:
presentRunning();
break;
case GAME_PAUSED:
presentPaused();
break;
case GAME_LEVEL_END:
presentLevelEnd();
break;
case GAME_OVER:
presentGameOver();
break;
}
batcher.end();
}
示例7: render
import com.badlogic.gdx.graphics.GLCommon; //导入方法依赖的package包/类
@Override
public void render () {
GLCommon gl = Gdx.gl;
long startPhysics = TimeUtils.nanoTime();
field.tick((long)(Gdx.graphics.getDeltaTime() * 3000), 4);
physicsMean.addValue((TimeUtils.nanoTime() - startPhysics) / 1000000000.0f);
gl.glClear(GL10.GL_COLOR_BUFFER_BIT);
cam.viewportWidth = field.getWidth();
cam.viewportHeight = field.getHeight();
cam.position.set(field.getWidth() / 2, field.getHeight() / 2, 0);
cam.update();
renderer.setProjectionMatrix(cam.combined);
long startRender = TimeUtils.nanoTime();
renderer.begin();
int len = field.getFieldElements().size();
for (int i = 0; i < len; i++) {
FieldElement element = field.getFieldElements().get(i);
element.draw(renderer);
}
renderer.end();
field.flock.removeBalls();
renderer.begin();
field.flock.run(renderer);
field.player.update(Gdx.graphics.getDeltaTime());
field.player.render();
renderer.end();
renderMean.addValue((TimeUtils.nanoTime() - startRender) / 1000000000.0f);
score = String.valueOf(field.player.score);
spriteBatch.begin();
font.draw(spriteBatch, scoreText, 0, Gdx.graphics.getHeight());
font.draw(spriteBatch, score, 0 + font.getBounds(scoreText).width + 5, Gdx.graphics.getHeight());
spriteBatch.end();
if (TimeUtils.nanoTime() - startTime > 1000000000) {
Gdx.app.log("Bouncy", "fps: " + Gdx.graphics.getFramesPerSecond() + ", physics: " + physicsMean.getMean() * 1000
+ ", rendering: " + renderMean.getMean() * 1000);
startTime = TimeUtils.nanoTime();
}
}