本文整理汇总了Java中com.badlogic.gdx.graphics.GL30类的典型用法代码示例。如果您正苦于以下问题:Java GL30类的具体用法?Java GL30怎么用?Java GL30使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
GL30类属于com.badlogic.gdx.graphics包,在下文中一共展示了GL30类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: 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))
{
if(isWinner)
{
AudioManager.getCurrentMusic().stop();
}else
{
AudioManager.getCurrentMusic().stop();
}
server.stopServer();
game.setScreen(new MenuScreen(game, client, server));
}
}
开发者ID:Aeo-Informatik,项目名称:Space-Bombs,代码行数:34,代码来源:WinnerScreen.java
示例17: getRenderables
import com.badlogic.gdx.graphics.GL30; //导入依赖的package包/类
@Override
public void getRenderables(Array<Renderable> renderables, Pool<Renderable> pool) {
if (Gdx.input.isKeyJustPressed(Input.Keys.N)) {
heightData[MathUtils.random(0, heightData.length-1)] = MathUtils.random(0, 1024);
update();
}
modelInstance.nodes.forEach(n -> n.parts.forEach(p -> p.meshPart.primitiveType = GL30.GL_LINES));
modelInstance.getRenderables(renderables, pool);
}
开发者ID:ncguy2,项目名称:Argent,代码行数:10,代码来源:Terrain.java
示例18: createDefaultPlayerCharacter
import com.badlogic.gdx.graphics.GL30; //导入依赖的package包/类
public static WorldObjectCharacter createDefaultPlayerCharacter(GameWorld.Generic world) {
modelBuilder.begin();
MeshPartBuilder builder = modelBuilder.part("player_body", GL30.GL_TRIANGLES, VertexAttributes.Usage.Position | VertexAttributes.Usage.Normal | VertexAttributes.Usage.TextureCoordinates, Reference.Defaults.Models.material());
CapsuleShapeBuilder.build(builder, 75, 500, 64);
WorldObject obj = new WorldObject(world, new ModelInstance(modelBuilder.end()));
if(world instanceof GameWorld.Physics) {
world.addInstance(new BulletEntity<>(world, obj.transform(), obj));
}else{
world.addInstance(obj);
}
return new WorldObjectCharacter(obj);
}
开发者ID:ncguy2,项目名称:Argent,代码行数:13,代码来源:WorldObjectCharacter.java
示例19: createDepthTextre
import com.badlogic.gdx.graphics.GL30; //导入依赖的package包/类
/**
* старый но! рабочий код) создания текстуры для буфера глубины. оставлен для истории
*/
@Deprecated
public void createDepthTextre(Texture.TextureFilter filter, Texture.TextureWrap wrap)
{
// сначала биндим наш буфер
gl.glBindFramebuffer(GL20.GL_FRAMEBUFFER, getFramebufferHandle());
// создаем текстуру
_depthTexture = gl.glGenTexture();
// биндим ее
gl.glBindTexture(GL11.GL_TEXTURE_2D, _depthTexture);
gl.glTexImage2D(
GL11.GL_TEXTURE_2D, 0,
GL14.GL_DEPTH_COMPONENT16, width, height,
0, GL11.GL_DEPTH_COMPONENT, GL11.GL_FLOAT, null);
// сделаем сглаживание
gl.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, filter.getGLEnum());
gl.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, filter.getGLEnum());
gl.glTexParameteri(GL11.GL_TEXTURE_2D, GL20.GL_TEXTURE_WRAP_S, wrap.getGLEnum());
gl.glTexParameteri(GL11.GL_TEXTURE_2D, GL20.GL_TEXTURE_WRAP_T, wrap.getGLEnum());
// связываем нашу текстуру с буфером
gl.glFramebufferTexture2D(GL20.GL_FRAMEBUFFER, GL30.GL_DEPTH_ATTACHMENT,
GL20.GL_TEXTURE_2D,
_depthTexture, 0);
// а вот тут может случится ата-та. т.к. надо знать ид буфера экрана. см код libgdx
gl.glBindFramebuffer(GL20.GL_FRAMEBUFFER, 0);
}
开发者ID:arksu,项目名称:origin,代码行数:31,代码来源:DepthFrameBuffer.java
示例20: init
import com.badlogic.gdx.graphics.GL30; //导入依赖的package包/类
/**
* Initializes the screen for drawing on it. It also stops the spriteBatch for a transparent background.
*
* @param spriteBatch
* The sprite batch to draw on.
*/
private static void init(SpriteBatch spriteBatch)
{
spriteBatch.end();
Gdx.gl.glEnable(GL30.GL_BLEND);
Gdx.gl.glBlendFunc(GL30.GL_SRC_ALPHA, GL30.GL_ONE_MINUS_SRC_ALPHA);
__shapeRenderer.setProjectionMatrix(METRO.__camera.combined);
__shapeRenderer.begin(ShapeType.Filled);
__shapeRenderer.setColor(__r, __g, __b, __a);
}
开发者ID:hauke96,项目名称:METRO,代码行数:17,代码来源:Fill.java
注:本文中的com.badlogic.gdx.graphics.GL30类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论