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


Java GL30类代码示例

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


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

示例1: render

import com.badlogic.gdx.graphics.GL30; //导入依赖的package包/类
/**------------------------RENDER------------------------**/
@Override
public void render(float f) 
{
    //Debug
    //stage.setDebugAll(true);
    
    //Clear Screen
    Gdx.gl.glClearColor(0.2f, 0.2f, 0.2f, 1);
    Gdx.gl.glClear(GL30.GL_COLOR_BUFFER_BIT);
    
     //Draw stage
    stage.act(Constants.DELTATIME);
    stage.draw();
    
    /*------------------SWITCH TO FULLSCREEN AND BACK------------------*/
    super.changeToFullScreenOnF12();
    
    /*------------------QUIT GAME------------------*/
    if (Gdx.input.isKeyPressed(Input.Keys.ESCAPE))
    {
        game.setScreen(new MenuScreen(game, client, server));
    }
}
 
开发者ID:Aeo-Informatik,项目名称:Space-Bombs,代码行数:25,代码来源:HelpScreen.java

示例2: render

import com.badlogic.gdx.graphics.GL30; //导入依赖的package包/类
/**------------------------RENDER------------------------**/
@Override
public void render(float f) 
{        
    //Debug
    //stage.setDebugAll(true);
    
    //Clear Screen
    Gdx.gl.glClearColor(0.2f, 0.2f, 0.2f, 1);
    Gdx.gl.glClear(GL30.GL_COLOR_BUFFER_BIT);
    
    //Set background image
    rootTable.background(new TextureRegionDrawable(new TextureRegion(TextureManager.menuBackground)));

    //Draw stage
    stage.act(Gdx.graphics.getDeltaTime());
    stage.draw();
    
    /*------------------SWITCH TO FULLSCREEN AND BACK------------------*/
    super.changeToFullScreenOnF12();
    
}
 
开发者ID:Aeo-Informatik,项目名称:Space-Bombs,代码行数:23,代码来源:MenuScreen.java

示例3: render

import com.badlogic.gdx.graphics.GL30; //导入依赖的package包/类
/**------------------------RENDER------------------------**/
    @Override
    public void render(float f) 
    {        
        //Debug
//        stage.setDebugAll(true);
        
        //Clear Screen
        Gdx.gl.glClearColor(0.2f, 0.2f, 0.2f, 1);
        Gdx.gl.glClear(GL30.GL_COLOR_BUFFER_BIT);
        
        //Draw stage
        stage.act(Constants.DELTATIME);
        stage.draw();
        
        /*------------------SWITCH TO FULLSCREEN AND BACK------------------*/
        super.changeToFullScreenOnF12();
        
        /*------------------QUIT GAME------------------*/
        if (Gdx.input.isKeyJustPressed(Input.Keys.ESCAPE))
        {

            game.setScreen(new HostScreen(game, client, server));
        }
    }
 
开发者ID:Aeo-Informatik,项目名称:Space-Bombs,代码行数:26,代码来源:HostSettingsScreen1.java

示例4: init

import com.badlogic.gdx.graphics.GL30; //导入依赖的package包/类
public void init() {
    final int numVertices = this.vertexResolution * this.vertexResolution;
    final int numIndices = (this.vertexResolution-1) * (this.vertexResolution-1) * 6;

    mesh = new Mesh(true, numVertices, numIndices, attribs);
    this.vertices = new float[numVertices * stride];
    mesh.setIndices(buildIndices());
    buildVertices();
    mesh.setVertices(vertices);

    MeshPart meshPart = new MeshPart(null, mesh, 0, numIndices, GL30.GL_TRIANGLES);
    meshPart.update();
    ModelBuilder mb = new ModelBuilder();
    mb.begin();
    mb.part(meshPart, material);
    model = mb.end();
    modelInstance = new ModelInstance(model);
    modelInstance.transform = transform;
}
 
开发者ID:ncguy2,项目名称:Argent,代码行数:20,代码来源:Terrain.java

示例5: constructCells

import com.badlogic.gdx.graphics.GL30; //导入依赖的package包/类
public void constructCells() {
    builder.begin();

    int vertAttrs = Position | Normal | TextureCoordinates;


    for(int x = 0; x < cells.length; x++) {
        for (int z = 0; z < cells[x].length; z++) {
            MeshPartBuilder partBuilder = builder.part("cell"+x+","+z, GL30.GL_TRIANGLES, vertAttrs, Reference.Defaults.Models.material());
            partBuilder.rect(getPoint("D", x, z), getPoint("C", x, z), getPoint("B", x, z), getPoint("A", x, z), Vector3.Y);
            cells[x][z].setCellPart(partBuilder.getMeshPart());
            cells[x][z].init();
        }
    }
    model = builder.end();
    instance = new ModelInstance(model);
}
 
开发者ID:ncguy2,项目名称:Argent,代码行数:18,代码来源:LandscapeWorldActor.java

示例6: draw

import com.badlogic.gdx.graphics.GL30; //导入依赖的package包/类
public void draw(GameMap map, Batch batch) {
	if (map == null) {
		return;
	}

	if (additive)
		batch.setBlendFunction(GL30.GL_SRC_ALPHA, GL30.GL_ONE);

	Particle[] particles = this.particles;
	boolean[] active = this.active;
	Vector2 tempVector = MathUtil.getVector2();

	for (int i = 0, n = maxParticleCount; i < n; i++)
		if (active[i]) {
			tempVector.set(particles[i].getX() + particles[i].getOriginX(),
					particles[i].getY() + particles[i].getOriginY());
			map.projectToTiles(tempVector);
			if (map.shouldRenderTile((int) tempVector.x, (int) tempVector.y)) {
				particles[i].draw(batch);
			}

		}
	MathUtil.freeVector2(tempVector);
	if (additive)
		batch.setBlendFunction(GL30.GL_SRC_ALPHA, GL30.GL_ONE_MINUS_SRC_ALPHA);
}
 
开发者ID:mganzarcik,项目名称:fabulae,代码行数:27,代码来源:WeatherParticleEmitter.java

示例7: render

import com.badlogic.gdx.graphics.GL30; //导入依赖的package包/类
@Override
public void render(float delta) {
	// get any missing assets
	Assets.getAssetManager().update();
	
	// update phase
	gameState.update(delta, camera);
	UIManager.updateUI(delta);
	cameraController.updateCamera(delta);		
	camera.update();
	
	// render phase
	Gdx.gl.glClearColor(0f, 0f, 0f, 1f);
	Gdx.gl.glClear(GL30.GL_COLOR_BUFFER_BIT);
	renderer.render(delta, camera);
	UIManager.drawUI();
}
 
开发者ID:mganzarcik,项目名称:fabulae,代码行数:18,代码来源:GameMapScreen.java

示例8: getFrameBufferPixmap

import com.badlogic.gdx.graphics.GL30; //导入依赖的package包/类
public Pixmap getFrameBufferPixmap(Viewport viewport) {
    int w = viewport.getScreenWidth();
    int h = viewport.getScreenHeight();
    int x = viewport.getScreenX();
    int y = viewport.getScreenY();
    final ByteBuffer pixelBuffer = BufferUtils.newByteBuffer(w * h * 4);

    Gdx.gl.glBindFramebuffer(GL20.GL_FRAMEBUFFER, fbo.getFramebufferHandle());
    Gdx.gl.glReadPixels(x, y, w, h, GL30.GL_RGBA, GL30.GL_UNSIGNED_BYTE, pixelBuffer);
    Gdx.gl.glBindFramebuffer(GL20.GL_FRAMEBUFFER, 0);

    final int numBytes = w * h * 4;
    byte[] imgLines = new byte[numBytes];
    final int numBytesPerLine = w * 4;
    for (int i = 0; i < h; i++) {
        pixelBuffer.position((h - i - 1) * numBytesPerLine);
        pixelBuffer.get(imgLines, i * numBytesPerLine, numBytesPerLine);
    }

    Pixmap pixmap = new Pixmap(w, h, Pixmap.Format.RGBA8888);
    BufferUtils.copy(imgLines, 0, pixmap.getPixels(), imgLines.length);

    return pixmap;
}
 
开发者ID:mbrlabs,项目名称:Mundus,代码行数:25,代码来源:BasePicker.java

示例9: beforeRender

import com.badlogic.gdx.graphics.GL30; //导入依赖的package包/类
@Override
public void beforeRender(Renderable renderable) {
  context.setDepthMask(true);
  context.setDepthTest(GL30.GL_LESS);
  if (env.depthShaderMode == LevelEnv.DepthShaderMode.Normal) {
    shader.setUniformf(UNIFORM_TRANSPARENT_DEPTH, 1.0f);
    if (BaseRenderable.haveTransparency(renderable.material)) {
      context.setCullFace(GL30.GL_NONE);
    } else {
      context.setCullFace(GL20.GL_FRONT);
    }
  } else {
    shader.setUniformf(UNIFORM_TRANSPARENT_DEPTH, 1.0f);
    context.setCullFace(GL20.GL_BACK);
  }

}
 
开发者ID:macbury,项目名称:ForgE,代码行数:18,代码来源:DepthShader.java

示例10: buildFactoryFor

import com.badlogic.gdx.graphics.GL30; //导入依赖的package包/类
private VoxelChunkRenderableFactory buildFactoryFor(Chunk chunk, VoxelsAssembler assembler, Material material) {
  if (assembler.isEmpty()) {
    return null;
  } else {
    VoxelChunkRenderableFactory voxelChunkRenderableFactory = new VoxelChunkRenderableFactory();
    voxelChunkRenderableFactory.material                    = material;
    voxelChunkRenderableFactory.primitiveType               = GL30.GL_TRIANGLES;

    if (ForgE.config.getBool(Config.Key.GenerateWireframe))
      voxelChunkRenderableFactory.wireframe           = assembler.wireframe();
    voxelChunkRenderableFactory.triangleCount         = assembler.getTriangleCount();
    voxelChunkRenderableFactory.attributes            = MeshVertexInfo.voxelTypes();
    voxelChunkRenderableFactory.meshFactory           = assembler.meshFactory(voxelChunkRenderableFactory.attributes);
    return voxelChunkRenderableFactory;
  }
}
 
开发者ID:macbury,项目名称:ForgE,代码行数:17,代码来源:TerrainBuilder.java

示例11: buildFaceForChunkWithAssembler

import com.badlogic.gdx.graphics.GL30; //导入依赖的package包/类
private VoxelChunkRenderable buildFaceForChunkWithAssembler(Chunk chunk, VoxelsAssembler assembler, boolean haveTransparency) {
  if (!assembler.isEmpty()) {
    VoxelChunkRenderable renderable   = new VoxelChunkRenderable();
    renderable.primitiveType          = GL30.GL_TRIANGLES;

    if (ForgE.config.getBool(Config.Key.GenerateWireframe))
      renderable.wireframe           = assembler.wireframe();
    renderable.triangleCount         = assembler.getTriangleCount();
    renderable.meshFactory           = assembler.meshFactory(MeshVertexInfo.voxelTypes());

    renderable.worldTransform.idt();
    renderable.material = new Material(new SolidTerrainAttribute());
    if (haveTransparency) {
      renderable.material.set(new BlendingAttribute(true,1f));
    }

    chunk.addFace(renderable);
    return renderable;
  } else {
    return null;
  }
}
 
开发者ID:macbury,项目名称:ForgE,代码行数:23,代码来源:TerrainBuilder.java

示例12: render

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

  //TODO background

  localTSR.draw(game.cRenderer);
  visitorTSR.draw(game.cRenderer);

  ShapeRenderer shapeRenderer = game.cRenderer.shape;
  shapeRenderer.begin(ShapeRenderer.ShapeType.Filled);
  shapeRenderer.setColor(new Color(0, 0, 1, 1));
  shapeRenderer.rect(button.x, button.y, button.width, button.height);
  shapeRenderer.end();
}
 
开发者ID:bubuntux,项目名称:javacup,代码行数:17,代码来源:VersusScreen.java

示例13: render

import com.badlogic.gdx.graphics.GL30; //导入依赖的package包/类
/**------------------------RENDER------------------------**/
@Override
public void render(float f) 
{        
    //Debug
    //stage.setDebugAll(true);
    
    if(Gdx.graphics.isFullscreen())
    {
        checkBoxFullscreen.setChecked(true);
    }else
    {
        checkBoxFullscreen.setChecked(false);
    }
    
    //Clear Screen
    Gdx.gl.glClearColor(0.2f, 0.2f, 0.2f, 1);
    Gdx.gl.glClear(GL30.GL_COLOR_BUFFER_BIT);
    
    //Draw stage
    stage.act(Constants.DELTATIME);
    stage.draw();
    
    /*------------------SWITCH TO FULLSCREEN AND BACK------------------*/
    super.changeToFullScreenOnF12();
    
    /*------------------QUIT GAME------------------*/
    if (Gdx.input.isKeyJustPressed(Input.Keys.ESCAPE))
    {
        game.setScreen(new MenuScreen(game, client, server));
    }
}
 
开发者ID:Aeo-Informatik,项目名称:Space-Bombs,代码行数:33,代码来源:OptionScreen.java

示例14: render

import com.badlogic.gdx.graphics.GL30; //导入依赖的package包/类
/**------------------------RENDER------------------------**/
    @Override
    public void render(float f) 
    {        
        //Debug
//        stage.setDebugAll(true);
        
        //Clear Screen
        Gdx.gl.glClearColor(0.2f, 0.2f, 0.2f, 1);
        Gdx.gl.glClear(GL30.GL_COLOR_BUFFER_BIT);
        
        //Draw stage
        stage.act(Constants.DELTATIME);
        stage.draw();
        
        /*------------------SWITCH TO FULLSCREEN AND BACK------------------*/
        super.changeToFullScreenOnF12();
        
        /*------------------QUIT GAME------------------*/
        if (Gdx.input.isKeyJustPressed(Input.Keys.ESCAPE))
        {
            if(oldMaxPlayerValue != maxPlayers)
            {
                server.resetServer();
            }
            
            game.setScreen(new HostScreen(game, client, server));
        }
    }
 
开发者ID:Aeo-Informatik,项目名称:Space-Bombs,代码行数:30,代码来源:HostSettingsScreen.java

示例15: render

import com.badlogic.gdx.graphics.GL30; //导入依赖的package包/类
/**------------------------RENDER------------------------**/
@Override
public void render(float f) 
{
    //Debug
    //stage.setDebugAll(true);
    
    //Clear Screen
    Gdx.gl.glClearColor(0.2f, 0.2f, 0.2f, 1);
    Gdx.gl.glClear(GL30.GL_COLOR_BUFFER_BIT);
    
    //Set background image
    rootTable.background(new TextureRegionDrawable(new TextureRegion(TextureManager.menuBackground)));
    
    //Render stage
    stage.act(Constants.DELTATIME);
    stage.draw();
    
    /*------------------SWITCH TO FULLSCREEN AND BACK------------------*/
    super.changeToFullScreenOnF12();
    
    /*------------------QUIT GAME------------------*/
    if (Gdx.input.isKeyPressed(Input.Keys.ESCAPE))
    {
        game.setScreen(new MenuScreen(game, client, server));
    }
    
    /*------------------JOIN GAME WITH ENTER------------------*/
    if(Gdx.input.isKeyJustPressed(Input.Keys.ENTER))
    {
        ChangeEvent event1 = new ChangeEvent();
        joinButton.fire(event1);
    }
}
 
开发者ID:Aeo-Informatik,项目名称:Space-Bombs,代码行数:35,代码来源:JoinScreen.java


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