當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。