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


Java GL10类代码示例

本文整理汇总了Java中com.badlogic.gdx.graphics.GL10的典型用法代码示例。如果您正苦于以下问题:Java GL10类的具体用法?Java GL10怎么用?Java GL10使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


GL10类属于com.badlogic.gdx.graphics包,在下文中一共展示了GL10类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: draw

import com.badlogic.gdx.graphics.GL10; //导入依赖的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: renderGL1

import com.badlogic.gdx.graphics.GL10; //导入依赖的package包/类
@Override
public void renderGL1(GL10 gl, float gameTime) {
	
	gl.glEnable(GL10.GL_TEXTURE_2D);
	gl.glEnable(GL10.GL_LIGHTING);
	gl.glColor4f(color.r, color.g, color.b, color.a);
	
	texture.bind();
	
	gl.glPushMatrix();
	gl.glTranslatef(position.x, position.y, position.z);
	gl.glRotatef(rotate.x, 1, 0, 0);
	gl.glRotatef(rotate.y, 0, 1, 0);
	gl.glRotatef(rotate.z, 0, 0, 1);
	gl.glScalef(scale.x, scale.y, scale.z);
	model.render();
	gl.glPopMatrix();
}
 
开发者ID:game-libgdx-unity,项目名称:GDX-Engine,代码行数:19,代码来源:DefaultObject3D.java

示例3: render

import com.badlogic.gdx.graphics.GL10; //导入依赖的package包/类
@Override
public void render() {
	float delta = Gdx.graphics.getDeltaTime();
	if (durAccum > 0f) {
		durAccum -= delta;
		if (durAccum <= 0f) {
			currentScreen.hide();
			currentScreen.remove();
			currentScreen = nextScreen;
			currentScreen.setTouchable(Touchable.enabled);
			currentScreen.setPosition(0f, 0f);
			nextScreen = null;
		}
	}
	Gdx.gl.glClearColor(clearColor.r, clearColor.g, clearColor.b, clearColor.a);
	Gdx.gl.glClear(GL10.GL_COLOR_BUFFER_BIT);
	stage.act(delta);
	stage.draw();
}
 
开发者ID:Namek,项目名称:lets-code-game,代码行数:20,代码来源:UiApp.java

示例4: drawPause

import com.badlogic.gdx.graphics.GL10; //导入依赖的package包/类
public void drawPause() {
	if (paused) {
		Gdx.gl.glEnable(GL10.GL_BLEND);
		Gdx.gl.glBlendFunc(GL10.GL_SRC_ALPHA, GL10.GL_ONE_MINUS_SRC_ALPHA);
		shapeRenderer.setProjectionMatrix(camera.combined);
		shapeRenderer.begin(ShapeType.Filled);
		shapeRenderer.setColor(0f, 0f, 0f, 0.2f);
		shapeRenderer.rect(0, 0, imageProvider.getScreenWidth(), imageProvider.getScreenHeight());
		shapeRenderer.end();
		Gdx.gl.glDisable(GL10.GL_BLEND);

		batch.setProjectionMatrix(camera.combined);
		batch.begin();
		batch.draw(restart, unpauseBounds.x, unpauseBounds.y);
		batch.draw(backButton, pausedBackBounds.x, pausedBackBounds.y, pausedBackBounds.width, pausedBackBounds.height);
		batch.end();
	}
}
 
开发者ID:RyanMan56,项目名称:Runners,代码行数:19,代码来源:GameScreen.java

示例5: displayUnlockMessage

import com.badlogic.gdx.graphics.GL10; //导入依赖的package包/类
public void displayUnlockMessage(SpriteBatch batch) {
	endSlateAlpha = 0;

	Gdx.gl.glEnable(GL10.GL_BLEND);
	Gdx.gl.glBlendFunc(GL10.GL_SRC_ALPHA, GL10.GL_ONE_MINUS_SRC_ALPHA);
	shapeRenderer.setProjectionMatrix(camera.combined);
	shapeRenderer.begin(ShapeType.Filled);
	shapeRenderer.setColor(0f, 0f, 0f, 0.3f);
	shapeRenderer.rect(0, 0, imageProvider.getScreenWidth(), imageProvider.getScreenHeight());
	shapeRenderer.end();
	Gdx.gl.glDisable(GL10.GL_BLEND);

	batch.setProjectionMatrix(camera.combined);
	batch.begin();
	batch.setColor(batch.getColor().r, batch.getColor().g, batch.getColor().b, 1);
	unlockPodium.render(batch);
	batch.draw(characterUnlocked, 10, imageProvider.getScreenHeight() - 19, characterUnlocked.getWidth() / 2, characterUnlocked.getHeight() / 2);
	batch.end();

	if (System.currentTimeMillis() - unlockTime > 1000)
		if (Gdx.input.isTouched())
			shouldDrawCharacterUnlock = false;
}
 
开发者ID:RyanMan56,项目名称:Runners,代码行数:24,代码来源:GameScreen.java

示例6: render

import com.badlogic.gdx.graphics.GL10; //导入依赖的package包/类
@Override
public void render() {
    Gdx.gl10.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT);
    Gdx.gl10.glClearColor(0.5f, 0.5f, 0.5f, 1.0f);

    for (int i = 0; i < cameras.length; i++) {
        adjustCamera(i);
        drawShapes(i);
    }

    int width = Gdx.graphics.getWidth();
    int height = Gdx.graphics.getHeight();

    // All - Draw borders
    Border.draw(width, height);

    // camera descriptions
    drawCameraDescription(width, height);
}
 
开发者ID:navossoc,项目名称:vrmleditor,代码行数:20,代码来源:Renderer.java

示例7: render

import com.badlogic.gdx.graphics.GL10; //导入依赖的package包/类
@Override
public void render(float delta) {
	
	Gdx.gl.glClearColor(0f, 0f, 0f, 1f);
	Gdx.gl.glClear(GL10.GL_COLOR_BUFFER_BIT);
	
	tweenManager.update(delta);
	stage.act(delta);
	batch.begin();
	background.setBounds(0, 0, Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
	background.draw(batch);
	minions.draw(batch);
	batch.end();
	
	stage.draw();
}
 
开发者ID:bitbrain,项目名称:maze,代码行数:17,代码来源:MainMenuScreen.java

示例8: render

import com.badlogic.gdx.graphics.GL10; //导入依赖的package包/类
public void render(float delta) {
	Gdx.gl.glClearColor(0, 0, 0, 1);
	Gdx.gl.glClear(GL10.GL_COLOR_BUFFER_BIT);
	
	stage.act(delta);
	
	coinLabel.setText("Spendable Coins:  " + prefs.getLong("currency", 0));
	desTextLabel.setText(description);
	priceLabel.setText(price);
	desTitleLabel.setText(title);
	ownedLabel.setText(owned);
	
	
	batch.begin();
	stage.draw();
	batch.end();
	
}
 
开发者ID:AngryStickStudios,项目名称:StickFlick,代码行数:19,代码来源:Store.java

示例9: render

import com.badlogic.gdx.graphics.GL10; //导入依赖的package包/类
@Override
public void render() {
	Gdx.gl.glClearColor(0, 0.6f, 1, 1);
	Gdx.gl.glClear(GL10.GL_COLOR_BUFFER_BIT);

	if (Gdx.input.isKeyPressed(Keys.ESCAPE)) {
		Gdx.app.exit();
	}

	stage.act();
	gui.act();
	
	stage.draw();
	gui.draw();

}
 
开发者ID:karsc22,项目名称:FlumpGDX,代码行数:17,代码来源:FlumpGdx.java

示例10: render

import com.badlogic.gdx.graphics.GL10; //导入依赖的package包/类
@Override
public void render(float arg0) {
 Gdx.gl.glClearColor(0, 0, 0, 1);
 //Limpio la pantalla en el bucle render todo el rato.
 Gdx.gl.glClear(GL10.GL_COLOR_BUFFER_BIT);
	
 // Muestra un men� de inicio
 game.batch.begin();
 game.batch.draw(fondo, 0, 0, Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
	
 //Pinto los textos y en qu� posicion y las coordenadas donde quiero pintarlo.
 game.font.draw(game.batch, "", 100, 375);
 
 game.font.draw(game.batch, "Pulsa ESC para volver al men� principal.", 120, 20);
 game.batch.end();
 
 /*
  * Si el usuario toca la pantalla se inicia la partida
  */
 if (Gdx.input.isKeyPressed(Keys.ESCAPE)) {
  game.setScreen(new MainMenuScreen(game));
  dispose();
 }
 
}
 
开发者ID:Alariel91,项目名称:Crazy-Driver-VideoGame,代码行数:26,代码来源:EndScreen.java

示例11: render

import com.badlogic.gdx.graphics.GL10; //导入依赖的package包/类
@Override
public void render(float delta) {
    if (elapsed < DELAY) {
        float shade = 0.8f - elapsed / 1f;
        Gdx.gl.glClearColor(shade, shade, shade, 0);
        Gdx.gl.glClear(GL10.GL_COLOR_BUFFER_BIT);
    } else {
        if (elapsed + delta > DELAY) {
            Gdx.input.setInputProcessor(new GameOverInputProcessor());
        }

        game.fall();
        GameRenderer.instance.render(game);
        GameRenderer.instance.renderStartText("High score:", Integer.toString(highScore));
    }
    elapsed += delta;
}
 
开发者ID:michaelfairley,项目名称:flippy_bird,代码行数:18,代码来源:GameOverScreen.java

示例12: render

import com.badlogic.gdx.graphics.GL10; //导入依赖的package包/类
@Override
public void render(float delta) {
	Gdx.gl.glClearColor(0.2f, 0.2f, 0.2f, 1);
	Gdx.gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT);
	Gdx.gl.glEnable(GL20.GL_BLEND_SRC_ALPHA);

	batch.begin();

	// bitmapfont.draw(batch, "Version OPENGL : " + Gdx.gl.glGetString(GL20.GL_VERSION), 6, 291);
	// bitmapfont.draw(batch, "Graphics CARD : " + Gdx.gl.glGetString(GL20.GL_RENDERER), 6, 305);
	// bitmapfont.draw(batch, "OpenGL 2.0 ? : " + Gdx.graphics.isGL20Available(), 6, 321);

	// bitmapfont.draw(batch, "JAVA HEAP : " + Gdx.app.getJavaHeap() / 10E4, 6, 191);
	// bitmapfont.draw(batch, "FPS : " + Gdx.graphics.getFramesPerSecond(), 6, 210);
	meshCreator.drawMesh(); // comment this line and uncomment bitmapfont.draw to print infos but without the triangle...
	batch.end();
}
 
开发者ID:creationjeuxjava,项目名称:spaceShell,代码行数:18,代码来源:OpenGLTriangleScreen.java

示例13: render

import com.badlogic.gdx.graphics.GL10; //导入依赖的package包/类
@Override
public void render(float delta) {			
	if (am.update()){
		/*init music/sound here*/

		setTextures();

		game.play.create();

		game.setScreen(game.play);
	}

	progress = am.getProgress();	

	Gdx.gl.glClearColor(1f, 1f, 1f, 1f);
	Gdx.gl.glClear(GL10.GL_COLOR_BUFFER_BIT);
}
 
开发者ID:randombot,项目名称:bar,代码行数:18,代码来源:Loading.java

示例14: render

import com.badlogic.gdx.graphics.GL10; //导入依赖的package包/类
@Override
public void render(float delta) {
	if(gameRunning) {
		timeManager.addTime(delta);
		if(Gdx.input.isKeyPressed(Keys.DOWN)
				|| Gdx.input.isKeyPressed(Keys.RIGHT)
				|| Gdx.input.isKeyPressed(Keys.LEFT)
				|| Gdx.input.isTouched()) {
			timeManager.timeKeyPressed(delta);
		}
	}
	Gdx.gl.glClearColor(0f, 0f, 0.2f, 1);
	Gdx.gl.glClear(GL10.GL_COLOR_BUFFER_BIT);
	Gdx.gl.glEnable(GL10.GL_BLEND);
	batch.setProjectionMatrix(camera.combined);

	batch.begin();
	
	//batch.draw(background, w/2 - background.getWidth()/2, h/2 - background.getHeight()/2);
	batch.end();

	stage.act(delta);
	stage.draw();
	
}
 
开发者ID:dieubware,项目名称:Tetrek,代码行数:26,代码来源:GameScreen.java

示例15: render

import com.badlogic.gdx.graphics.GL10; //导入依赖的package包/类
@Override
public void render(SpriteBatch spriteBatch, OrthographicCamera camera) {
	shapeRenderer.setProjectionMatrix(this.camera.combined);
	if (shouldRenderGridLines) {
		renderGridLines();
	}

	renderGridObjects(spriteBatch);

	Gdx.graphics.getGLCommon().glEnable(GL10.GL_BLEND);
	if (activeOverlay == Overlays.NOISE_LEVEL) {
		renderNoiseLevelOverlay();
	} else if (activeOverlay != null) {
		renderGenericOverlay(activeOverlay);
	}

	if (shouldRenderTransitLines && transitLines.size() > 0) {
		for (TransitLine transitLine : transitLines) {
			transitLine.render(shapeRenderer);
		}
	}

	Gdx.graphics.getGLCommon().glDisable(GL10.GL_BLEND);
}
 
开发者ID:frigidplanet,项目名称:droidtowers,代码行数:25,代码来源:GameGridRenderer.java


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