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


Java GL10.glEnable方法代码示例

本文整理汇总了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();
}
 
开发者ID:game-libgdx-unity,项目名称:GDX-Engine,代码行数:19,代码来源:DefaultObject3D.java

示例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);
}
 
开发者ID:game-libgdx-unity,项目名称:GDX-Engine,代码行数:10,代码来源:BaseGameScene3D.java

示例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();
        }
 
开发者ID:game-libgdx-unity,项目名称:GDX-Engine,代码行数:30,代码来源:TestCamera.java

示例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();
}
 
开发者ID:game-libgdx-unity,项目名称:GDX-Engine,代码行数:44,代码来源:BaseGameScene3D.java


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