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


Java GL11.glDrawElements方法代码示例

本文整理汇总了Java中org.lwjgl.opengl.GL11.glDrawElements方法的典型用法代码示例。如果您正苦于以下问题:Java GL11.glDrawElements方法的具体用法?Java GL11.glDrawElements怎么用?Java GL11.glDrawElements使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.lwjgl.opengl.GL11的用法示例。


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

示例1: render

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
/**
    * Renders the VAO as triangles
    */
   @Override
   public void render() {
bind();

enableAttributes();

// Bind the EBO
GL15.glBindBuffer(GL15.GL_ELEMENT_ARRAY_BUFFER, getBufferObject(1));
// Render all the indexed vertices as triangles
GL11.glDrawElements(GL11.GL_TRIANGLES, vertexCount, GL11.GL_UNSIGNED_INT, 0);

disableAttributes();

unbind();
   }
 
开发者ID:camilne,项目名称:open-world,代码行数:19,代码来源:IndexedVAO.java

示例2: draw

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
@Override
public void draw(Asset<Mesh> modelMesh, Material material, Matrix4fc transformation)
{
	final Program program = this.program.get();
	final Mesh mesh = modelMesh.get();

	MaterialProperty.MODELVIEWPROJECTION.apply(program,
			this.viewProjection.mul(transformation, this.modelViewProjection));

	mesh.bind();
	{
		material.applyOrDefault(MaterialProperty.COLOR, program, new Vector4f(1, 1, 1, 0));

		GL11.glDrawElements(GL11.GL_LINE_LOOP, mesh.getVertexCount(), GL11.GL_UNSIGNED_INT, 0);
	}
	mesh.unbind();
}
 
开发者ID:andykuo1,项目名称:candlelight,代码行数:18,代码来源:WireframeRenderer.java

示例3: render

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
public void render(Map<TexturedModel, List<Entity>> entities) {
	for(TexturedModel model : entities.keySet()) {
		prepareTexturedModel(model);
		List<Entity> batch = entities.get(model);
		for(Entity entity : batch) {
			prepareInstance(entity);
			GL11.glDrawElements(GL11.GL_TRIANGLES, model.getRawModel().getVertexCount(), GL11.GL_UNSIGNED_INT, 0);
		}
		unbindTexturedModel();
	}
}
 
开发者ID:marcioz98,项目名称:MRCEngine,代码行数:12,代码来源:EntityRenderer.java

示例4: render

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
public void render(List<Terrain> terrains) {
	for(Terrain terrain : terrains) {
		prepareTerrain(terrain);
		loadModelMatrix(terrain);
		GL11.glDrawElements(GL11.GL_TRIANGLES, terrain.getModel().getVertexCount(), GL11.GL_UNSIGNED_INT, 0);
		unbindTexturedModel();
	}
}
 
开发者ID:marcioz98,项目名称:MRCEngine,代码行数:9,代码来源:TerrainRenderer.java

示例5: draw

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
public void draw(){
	GL30.glBindVertexArray(vao);
	GL20.glEnableVertexAttribArray(0);
	GL20.glEnableVertexAttribArray(1);
	
	GL11.glDrawElements(GL11.GL_TRIANGLES, 6, GL11.GL_UNSIGNED_INT, 0);
	
	GL20.glDisableVertexAttribArray(0);
	GL20.glDisableVertexAttribArray(1);
	GL30.glBindVertexArray(vao);
}
 
开发者ID:tek256,项目名称:LD38,代码行数:12,代码来源:Quad.java

示例6: render

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
public void render(List<Terrain> terrains) {
    for(Terrain t: terrains) {
        prepareTerrain(t);
        loadModelMatrix(t);
        GL11.glDrawElements(GL11.GL_TRIANGLES, t.getModel().getVertexCount(), GL11.GL_UNSIGNED_INT, 0);
        unbindTexturedModel();
    }
}
 
开发者ID:Essentria,项目名称:Elgin-Plant-Game,代码行数:9,代码来源:TerrainRenderer.java

示例7: draw

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
@Override
public void draw(Asset<Mesh> modelMesh, Material material, Matrix4fc transformation)
{
	final Program program = this.program.get();
	final Mesh mesh = modelMesh.get();

	MaterialProperty.MODELVIEWPROJECTION.apply(program,
			this.viewProjection.mul(transformation, this.modelViewProjection));

	mesh.bind();
	{
		boolean flag = material.apply(MaterialProperty.TEXTURE, program);

		material.applyOrDefault(MaterialProperty.COLOR, program, flag ? DEFAULT_PROPERTY_TEXTURE_COLOR : DEFAULT_PROPERTY_COLOR);
		material.applyOrDefault(MaterialProperty.SPRITE_OFFSET, program, DEFAULT_PROPERTY_SPRITE_OFFSET);
		material.applyOrDefault(MaterialProperty.SPRITE_SCALE, program, DEFAULT_PROPERTY_SPRITE_SCALE);
		material.applyOrDefault(MaterialProperty.TRANSPARENCY, program, DEFAULT_PROPERTY_TRANSPARENCY);

		GL11.glDrawElements(GL11.GL_TRIANGLES, mesh.getVertexCount(), GL11.GL_UNSIGNED_INT, 0);

		//Clean up
		if (flag)
		{
			Asset<Texture> texture = material.getProperty(MaterialProperty.TEXTURE);
			texture.get().unbind();
		}
	}
	mesh.unbind();
}
 
开发者ID:andykuo1,项目名称:candlelight,代码行数:30,代码来源:SimpleRenderer.java

示例8: render

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
public void render(List<WaterTile> water, ICamera camera, Vector3f lightDir) {
	prepareRender(camera, lightDir);
	for (WaterTile tile : water) {
		Matrix4f modelMatrix = createModelMatrix(tile.getX(), tile.getHeight(), tile.getZ(), WaterTile.TILE_SIZE);
		shader.modelMatrix.loadMatrix(modelMatrix);
		GL11.glDrawElements(GL11.GL_TRIANGLES, quad.getIndexCount(), GL11.GL_UNSIGNED_INT, 0);
	}
	finish();
}
 
开发者ID:TheThinMatrix,项目名称:OcclusionQueries,代码行数:10,代码来源:WaterRenderer.java

示例9: render

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
public void render(Shader shader, int modelMatrix, GameObject object, Camera camera) {
	GL11.glBindTexture(GL11.GL_TEXTURE_2D, object.getTextureID());
	Matrix4f transformationMatrix = createTransformationMatrix(object.getTransform());
	shader.loadMatrix(modelMatrix, transformationMatrix);
	object.update();
	GL11.glDrawElements(GL11.GL_TRIANGLES, indicesSize, GL11.GL_UNSIGNED_INT, 0);
}
 
开发者ID:ComunityEngine,项目名称:CommunityEngine-Java,代码行数:8,代码来源:Mesh.java

示例10: render

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
public void render(Map<TexturedModel, List<Entity>> entities) {
	for (TexturedModel model : entities.keySet()) {
		prepareTexturedModel(model);
		List<Entity> batch = entities.get(model);
		for (Entity entity : batch) {
			prepareInstance(entity);
			GL11.glDrawElements(GL11.GL_TRIANGLES, model.getRawModel().getVertexCount(), GL11.GL_UNSIGNED_INT, 0);
		}
		unbindTexturedModel();
	}
}
 
开发者ID:DevipriyaSarkar,项目名称:Terrain,代码行数:12,代码来源:EntityRenderer.java

示例11: render

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
public void render(List<Terrain> terrains) {
	for (Terrain terrain : terrains) {
		prepareTerrain(terrain);
		loadModelMatrix(terrain);
		GL11.glDrawElements(GL11.GL_TRIANGLES, terrain.getModel().getVertexCount(), GL11.GL_UNSIGNED_INT, 0);
		unbindTexturedModel();
	}
}
 
开发者ID:DevipriyaSarkar,项目名称:Terrain,代码行数:9,代码来源:TerrainRenderer.java

示例12: render

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
/**
 * Renders the skybox.
 * 
 * @param camera
 *            - the scene's camera.
 */
public void render(ICamera camera) {
	prepare(camera);
	box.bind(0);
	GL11.glDrawElements(GL11.GL_TRIANGLES, box.getIndexCount(), GL11.GL_UNSIGNED_INT, 0);
	box.unbind(0);
	shader.stop();
}
 
开发者ID:TheThinMatrix,项目名称:OpenGL-Animation,代码行数:14,代码来源:SkyboxRenderer.java

示例13: render

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
public void render(Terrain terrain, ICamera camera, Light light) {
    prepare(terrain, camera, light);
    if (hasIndices) {
        GL11.glDrawElements(GL11.GL_TRIANGLES, terrain.getVertexCount(), GL11.GL_UNSIGNED_INT, 0);
    } else {
        GL11.glDrawArrays(GL11.GL_TRIANGLES, 0, terrain.getVertexCount());
    }
    stop(terrain);
}
 
开发者ID:GryPLOfficial,项目名称:EcoSystem-Official,代码行数:10,代码来源:TerrainRenderer.java

示例14: render

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
public void render(List<Entity> shinyEntities, Texture enviromap, ICamera camera, Vector3f lightDir) {
	prepare(camera, lightDir, enviromap);
	for (Entity entity : shinyEntities) {
		entity.getSkin().getDiffuseTexture().bindToUnit(0);
		Vao model = entity.getModel().getVao();
		model.bind(0, 1, 2);
		GL11.glDrawElements(GL11.GL_TRIANGLES, model.getIndexCount(), GL11.GL_UNSIGNED_INT, 0);
		model.unbind(0, 1, 2);
	}
	finish();
}
 
开发者ID:TheThinMatrix,项目名称:OcclusionQueries,代码行数:12,代码来源:ShinyRenderer.java

示例15: render

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
public void render(List<Entity> entities, ICamera camera, Vector3f lightDir, Vector4f clipPlane) {
	prepare(camera, lightDir, clipPlane);
	for (Entity entity : entities) {
		prepareSkin(entity.getSkin());
		Vao model = entity.getModel().getVao();
		model.bind(0, 1, 2);
		GL11.glDrawElements(GL11.GL_TRIANGLES, model.getIndexCount(), GL11.GL_UNSIGNED_INT, 0);
		model.unbind(0, 1, 2);
	}
	finish();
}
 
开发者ID:TheThinMatrix,项目名称:OcclusionQueries,代码行数:12,代码来源:EntityRenderer.java


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