本文整理汇总了Java中com.badlogic.gdx.graphics.GLCommon类的典型用法代码示例。如果您正苦于以下问题:Java GLCommon类的具体用法?Java GLCommon怎么用?Java GLCommon使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
GLCommon类属于com.badlogic.gdx.graphics包,在下文中一共展示了GLCommon类的18个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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: renderGridLines
import com.badlogic.gdx.graphics.GLCommon; //导入依赖的package包/类
private void renderGridLines() {
GLCommon gl = Gdx.graphics.getGLCommon();
gl.glEnable(GL10.GL_BLEND);
shapeRenderer.begin(ShapeType.Line);
shapeRenderer.setColor(1f, 1f, 1f, 0.15f);
for (int i = 0; i <= gameGrid.getGridSize().x; i++) {
shapeRenderer.line(i * GRID_UNIT_SIZE, 0, i * GRID_UNIT_SIZE, gameGrid.getGridSize().y * GRID_UNIT_SIZE);
}
for (int i = 0; i <= gameGrid.getGridSize().y; i++) {
shapeRenderer.line(0, i * GRID_UNIT_SIZE, gameGrid.getGridSize().x * GRID_UNIT_SIZE, i * GRID_UNIT_SIZE);
}
shapeRenderer.end();
gl.glDisable(GL10.GL_BLEND);
}
开发者ID:frigidplanet,项目名称:droidtowers,代码行数:20,代码来源:GameGridRenderer.java
示例3: 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
示例4: 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
示例5: 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
示例6: draw
import com.badlogic.gdx.graphics.GLCommon; //导入依赖的package包/类
public void draw(ShapeRenderer shapeRender) {
if (mTable != null) {
Cell c = getSelectedCell(x, y);
if (c != null) {
Actor selected = (Actor) (c.getWidget());
if (selected != null) {
shapeRender.setColor(Blob.colors(mPlayer.id%Blob.COLORS.length));
GLCommon gl = Gdx.graphics.getGLCommon();
shapeRender.begin(ShapeType.Line);
shapeRender.box(mTable.getX()+selected.getX(), mTable.getY()+selected.getY(), 0, selected.getWidth(),
selected.getHeight(), 0);
gl.glLineWidth(3);
shapeRender.end();
gl.glLineWidth(1);
}
}
}
}
开发者ID:underclocker,项目名称:Blob-Game,代码行数:19,代码来源:CustomizeController.java
示例7: enableBlending
import com.badlogic.gdx.graphics.GLCommon; //导入依赖的package包/类
public void enableBlending()
{
renderMesh();
this.blendingDisabled = false;
if (this.drawing)
{
GLCommon localGLCommon = Gdx.gl;
localGLCommon.glEnable(3042);
localGLCommon.glBlendFunc(this.blendSrcFunc, this.blendDstFunc);
}
}
开发者ID:isnuryusuf,项目名称:ingress-indonesia-dev,代码行数:12,代码来源:SpriteBatch.java
示例8: end
import com.badlogic.gdx.graphics.GLCommon; //导入依赖的package包/类
public void end()
{
if (!this.drawing)
throw new IllegalStateException("SpriteBatch.begin must be called before end.");
if (this.idx > 0)
renderMesh();
this.lastTexture = null;
this.idx = 0;
this.drawing = false;
this.indexBuffer.unbind();
GLCommon localGLCommon = Gdx.gl;
localGLCommon.glDepthMask(true);
if (isBlendingEnabled())
localGLCommon.glDisable(3042);
if (Gdx.graphics.isGL20Available())
{
if (this.customShader != null)
{
this.customShader.end();
return;
}
this.shader.end();
return;
}
localGLCommon.glDisable(3553);
}
开发者ID:isnuryusuf,项目名称:ingress-indonesia-dev,代码行数:27,代码来源:SpriteBatch.java
示例9: end
import com.badlogic.gdx.graphics.GLCommon; //导入依赖的package包/类
public void end()
{
if (!this.drawing)
throw new IllegalStateException("PolygonSpriteBatch.begin must be called before end.");
if (this.idx > 0)
renderMesh();
this.lastTexture = null;
this.idx = 0;
this.drawing = false;
GLCommon localGLCommon = Gdx.gl;
localGLCommon.glDepthMask(true);
if (isBlendingEnabled())
localGLCommon.glDisable(3042);
if (Gdx.graphics.isGL20Available())
{
if (this.customShader != null)
{
this.customShader.end();
return;
}
this.shader.end();
return;
}
localGLCommon.glDisable(3553);
}
开发者ID:isnuryusuf,项目名称:ingress-indonesia-dev,代码行数:26,代码来源:PolygonSpriteBatch.java
示例10: 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
示例11: generateMipMapCPU
import com.badlogic.gdx.graphics.GLCommon; //导入依赖的package包/类
private static void generateMipMapCPU(Pixmap paramPixmap, int paramInt1, int paramInt2, boolean paramBoolean)
{
Gdx.gl.glTexImage2D(3553, 0, paramPixmap.getGLInternalFormat(), paramPixmap.getWidth(), paramPixmap.getHeight(), 0, paramPixmap.getGLFormat(), paramPixmap.getGLType(), paramPixmap.getPixels());
if ((Gdx.gl20 == null) && (paramInt1 != paramInt2))
throw new GdxRuntimeException("texture width and height must be square when using mipmapping.");
int i = paramPixmap.getWidth() / 2;
int j = paramPixmap.getHeight() / 2;
Pixmap.Blending localBlending = Pixmap.getBlending();
Pixmap.setBlending(Pixmap.Blending.None);
int k = 1;
Pixmap localPixmap;
for (Object localObject = paramPixmap; (i > 0) && (j > 0); localObject = localPixmap)
{
localPixmap = new Pixmap(i, j, ((Pixmap)localObject).getFormat());
localPixmap.drawPixmap((Pixmap)localObject, 0, 0, ((Pixmap)localObject).getWidth(), ((Pixmap)localObject).getHeight(), 0, 0, i, j);
if ((k > 1) || (paramBoolean))
((Pixmap)localObject).dispose();
GLCommon localGLCommon = Gdx.gl;
int m = localPixmap.getGLInternalFormat();
int n = localPixmap.getWidth();
int i1 = localPixmap.getHeight();
int i2 = localPixmap.getGLFormat();
int i3 = localPixmap.getGLType();
ByteBuffer localByteBuffer = localPixmap.getPixels();
localGLCommon.glTexImage2D(3553, k, m, n, i1, 0, i2, i3, localByteBuffer);
i = localPixmap.getWidth() / 2;
j = localPixmap.getHeight() / 2;
k++;
}
Pixmap.setBlending(localBlending);
}
开发者ID:isnuryusuf,项目名称:ingress-indonesia-dev,代码行数:32,代码来源:MipMapGenerator.java
示例12: LevelView
import com.badlogic.gdx.graphics.GLCommon; //导入依赖的package包/类
/**
* Constructor
*/
public LevelView() {
int w = Gdx.graphics.getWidth();
int h = Gdx.graphics.getHeight();
// Fullscreen toggle parameters
mFullScreenEnabled = false;
// Set virtual scale (it never changes)
mVScale = vHEIGHT / MIN_HEIGHT;
mOldWidth = w;
mOldHeight = h;
// Create Camera and SpriteBatch
mCamera = new OrthographicCamera();
mOldCamera = new OrthographicCamera();
mBatch = new SpriteBatch();
mShapeRenderer = new ShapeRenderer();
mDebug = new Box2DDebugRenderer();
if (mUseLights) {
mRayHandler = new RayHandler(null, w / 8, h / 8);
}
// Set width and height
mWidth = MIN_WIDTH;
mHeight = MIN_HEIGHT;
mClip = new Rectangle();
GLCommon gl10 = Gdx.graphics.getGLCommon();
gl10.glEnable(GL10.GL_LINE_SMOOTH);
gl10.glHint(GL10.GL_LINE_SMOOTH_HINT, GL10.GL_NICEST);
// Call onResize, so scale information is available in Game.create()
onResize(w, h);
mOldScale = mScale;
String vertexShader = "attribute vec4 a_position;\n" + "attribute vec4 a_color;\n"
+ "uniform mat4 u_worldView;\n" + "varying vec4 v_color; \n" + "void main(){\n"
+ "v_color = a_color;\n" + "gl_Position = u_worldView * a_position;\n" + "}\n";
String fragmentShader = "#ifdef GL_ES \n" + "precision mediump float; \n"
+ "#endif \n" + "varying vec4 v_color; \n"
+ "void main() \n" + "{ \n"
+ " gl_FragColor = v_color; \n" + "} \n";
if (Gdx.graphics.isGL20Available()) {
mDefaultShaderProgram = new ShaderProgram(vertexShader, fragmentShader);
if (!mDefaultShaderProgram.isCompiled())
throw new IllegalStateException(mDefaultShaderProgram.getLog());
}
}
开发者ID:underclocker,项目名称:Blob-Game,代码行数:51,代码来源:LevelView.java
示例13: getGLCommon
import com.badlogic.gdx.graphics.GLCommon; //导入依赖的package包/类
@Override
public GLCommon getGLCommon() {
throw new ServerGraphicsException();
}
开发者ID:Olloth,项目名称:LibGDXServer,代码行数:5,代码来源:ServerGraphics.java
示例14: 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
示例15: 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
示例16: getGLCommon
import com.badlogic.gdx.graphics.GLCommon; //导入依赖的package包/类
@Override
public GLCommon getGLCommon() {
// TODO Auto-generated method stub
return null;
}
开发者ID:javierj,项目名称:nikkylittlequest,代码行数:6,代码来源:TestStage.java
示例17: getGLCommon
import com.badlogic.gdx.graphics.GLCommon; //导入依赖的package包/类
public final GLCommon getGLCommon()
{
return Gdx.gl;
}
开发者ID:isnuryusuf,项目名称:ingress-indonesia-dev,代码行数:5,代码来源:AndroidGraphics.java
示例18: getGLCommon
import com.badlogic.gdx.graphics.GLCommon; //导入依赖的package包/类
public abstract GLCommon getGLCommon();
开发者ID:isnuryusuf,项目名称:ingress-indonesia-dev,代码行数:2,代码来源:Graphics.java
注:本文中的com.badlogic.gdx.graphics.GLCommon类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论