当前位置: 首页>>代码示例>>Java>>正文


Java GLCommon.glClear方法代码示例

本文整理汇总了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();
}
 
开发者ID:Nextpeer,项目名称:Nextpeer-libgdx-Sample,代码行数:30,代码来源:GameScreen.java

示例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);
}
 
开发者ID:Nextpeer,项目名称:Nextpeer-libgdx-Sample,代码行数:19,代码来源:HelpScreen2.java

示例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();
}
 
开发者ID:Nextpeer,项目名称:Nextpeer-libgdx-Sample,代码行数:20,代码来源:MainMenuScreen.java

示例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();
}
 
开发者ID:Nextpeer,项目名称:Nextpeer-libgdx-Sample,代码行数:25,代码来源:HighscoresScreen.java

示例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();
}
 
开发者ID:game-libgdx-unity,项目名称:GDX-Engine,代码行数:39,代码来源:BaseGameScene3D.java

示例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();
}
 
开发者ID:javileyes,项目名称:pruebaGit1,代码行数:30,代码来源:GameScreen.java

示例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();
	}

}
 
开发者ID:ericrius1,项目名称:SuperSumo,代码行数:48,代码来源:Bouncy.java


注:本文中的com.badlogic.gdx.graphics.GLCommon.glClear方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。