本文整理汇总了Java中com.badlogic.gdx.graphics.GL10.glEnable方法的典型用法代码示例。如果您正苦于以下问题:Java GL10.glEnable方法的具体用法?Java GL10.glEnable怎么用?Java GL10.glEnable使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.badlogic.gdx.graphics.GL10
的用法示例。
在下文中一共展示了GL10.glEnable方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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();
}
示例2: setLighting
import com.badlogic.gdx.graphics.GL10; //导入方法依赖的package包/类
protected void setLighting(GL10 gl) {
float[] direction = {1, 0.5f, 0, 0};
gl.glEnable(GL10.GL_LIGHTING);
gl.glEnable(GL10.GL_LIGHT0);
gl.glLightfv(GL10.GL_LIGHT0, GL10.GL_POSITION, direction, 0);
gl.glEnable(GL10.GL_COLOR_MATERIAL);
}
示例3: render
import com.badlogic.gdx.graphics.GL10; //导入方法依赖的package包/类
@Override
public void render() {
handleInput();
GL10 gl = Gdx.graphics.getGL10();
// Camera --------------------- /
gl.glClear(GL10.GL_COLOR_BUFFER_BIT);
cam.update();
cam.apply(gl);
// Texturing --------------------- /
gl.glActiveTexture(GL10.GL_TEXTURE0);
gl.glEnable(GL10.GL_TEXTURE_2D);
texture.bind();
mesh.render(GL10.GL_TRIANGLES);
Vector2 mouseOnScreen = getMouseScreen();
batch.begin();
font.draw(batch, "Mouse X: " + mouseOnScreen.x + " Mouse Y: "+mouseOnScreen.y, 0, font.getCapHeight());
// x /= scale;
// y /= scale;
//
// font.draw(batch, "Mouse X: " + x + " Mouse Y: "+y, 0, font.getCapHeight() * 2 + 10);
batch.end();
}
示例4: renderGL1
import com.badlogic.gdx.graphics.GL10; //导入方法依赖的package包/类
@Override
public void renderGL1(GL10 gl,float gameTime)
{
gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT);
gl.glViewport(0, 0, Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
SpriteBatch batch = getSpriteBatch();
viewMatrix.setToOrtho2D(0, 0, Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
batch.setProjectionMatrix(viewMatrix);
batch.begin();
batch.disableBlending();
//begin render background
renderBackground(gameTime);
batch.end();
gl.glDisable(GL10.GL_DITHER);
gl.glEnable(GL10.GL_DEPTH_TEST);
gl.glEnable(GL10.GL_CULL_FACE);
camera.update();
camera.apply(gl);
setLighting(gl);
for(IDrawable3D obj : collection)
if(obj.isVisible())
{
obj.renderGL1(gl, gameTime);
}
gl.glDisable(GL10.GL_CULL_FACE);
gl.glDisable(GL10.GL_DEPTH_TEST);
batch.setProjectionMatrix(viewMatrix);
//batch.setTransformMatrix(transformMatrix);
batch.begin();
batch.enableBlending();
//begin render foreground
renderForeground(gameTime);
batch.enableBlending();
batch.setBlendFunction(GL10.GL_ONE, GL10.GL_ONE_MINUS_SRC_ALPHA);
batch.end();
}