本文整理汇总了Java中org.lwjgl.opengl.GL11.glCullFace方法的典型用法代码示例。如果您正苦于以下问题:Java GL11.glCullFace方法的具体用法?Java GL11.glCullFace怎么用?Java GL11.glCullFace使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.lwjgl.opengl.GL11
的用法示例。
在下文中一共展示了GL11.glCullFace方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: renderChunk
import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
private static void renderChunk(Chunk chunk) {
if (!chunk.isUpdate()) {
if (chunks.containsKey(chunk.getId())) GL11.glDeleteLists(chunks.get(chunk.getId()), 1);
else chunks.put(chunk.getId(), GL11.glGenLists(1));
GL11.glNewList(chunks.get(chunk.getId()), GL11.GL_COMPILE);
GL11.glBegin(GL11.GL_QUADS);
Block[][][] blocks = chunk.getBlocks();
for (int x = 0; x < 16; x++)
for (int y = 0; y < 32; y++)
for (int z = 0; z < 16; z++)
renderBlock(blocks[x][y][z], chunk.getLocation().clone().add(x, y, z));
GL11.glEnd();
GL11.glEndList();
chunk.setUpdate(true);
}
// Draw the chunk.
GL11.glEnable(GL11.GL_CULL_FACE);
GL11.glCullFace(GL11.GL_BACK);
GL11.glCallList(chunks.get(chunk.getId()));
GL11.glDisable(GL11.GL_CULL_FACE);
}
示例2: initGL
import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
/**
* Initialize OpenGL to default settings
*/
private void initGL() {
// Set the clear color
GL11.glClearColor(0, 0, 0, 1);
// Setup viewport
GL11.glViewport(0, 0, WINDOW.getWidth(), WINDOW.getHeight());
// Setup depth testing
GL11.glEnable(GL11.GL_DEPTH_TEST);
// Setup face culling (ccw)
GL11.glFrontFace(GL11.GL_CCW);
GL11.glCullFace(GL11.GL_BACK);
GL11.glEnable(GL11.GL_CULL_FACE);
// Setup blending
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_ONE, GL11.GL_ONE_MINUS_SRC_ALPHA);
// Enable MSAA
GL11.glEnable(GL13.GL_MULTISAMPLE);
}
示例3: cullBackFaces
import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
public static void cullBackFaces(boolean cull) {
if (cull && !cullingBackFace) {
GL11.glEnable(GL11.GL_CULL_FACE);
GL11.glCullFace(GL11.GL_BACK);
cullingBackFace = true;
} else if (!cull && cullingBackFace) {
GL11.glDisable(GL11.GL_CULL_FACE);
cullingBackFace = false;
}
}
示例4: cullFace
import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
public static void cullFace(int mode)
{
if (mode != cullState.field_179053_b)
{
cullState.field_179053_b = mode;
GL11.glCullFace(mode);
}
}
示例5: disableGL3D
import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
public static void disableGL3D() {
GL11.glEnable((int)3553);
GL11.glEnable((int)2929);
GL11.glDisable((int)3042);
GL11.glEnable((int)3008);
GL11.glDepthMask((boolean)true);
GL11.glCullFace((int)1029);
GL11.glDisable((int)2848);
GL11.glHint((int)3154, (int)4352);
GL11.glHint((int)3155, (int)4352);
}
示例6: disableGL3D
import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
public static void disableGL3D() {
GL11.glEnable(2896);
GL11.glDisable(2848);
GL11.glEnable(3553);
GL11.glEnable(2929);
GL11.glDisable(3042);
GL11.glEnable(3008);
GL11.glDepthMask(true);
GL11.glCullFace(1029);
}
示例7: cullFace
import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
private static void cullFace(int mode)
{
if (mode != cullState.mode)
{
cullState.mode = mode;
GL11.glCullFace(mode);
}
}
示例8: cullBackFaces
import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
public static void cullBackFaces(boolean cull) {
if (cull && !cullingBackFace) {
GL11.glEnable(GL11.GL_CULL_FACE);
GL11.glCullFace(GL11.GL_BACK);
cullingBackFace = true;
} else if (!cull && cullingBackFace) {
GL11.glDisable(GL11.GL_CULL_FACE);
cullingBackFace = false;
}
}
示例9: enableCulling
import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
public static void enableCulling() {
GL11.glEnable(GL11.GL_CULL_FACE);
GL11.glCullFace(GL11.GL_BACK);
}
示例10: enableCulling
import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
public static void enableCulling() {
GL11.glEnable(GL11.GL_CULL_FACE);
GL11.glCullFace(GL11.GL_BACK);
}
示例11: disableCulling
import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
public static void disableCulling() {
GL11.glDisable(GL11.GL_CULL_FACE);
GL11.glCullFace(GL11.GL_BACK);
}
示例12: enableCulling
import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
/**
* Enables culling.
*/
public static void enableCulling() {
GL11.glEnable(GL11.GL_CULL_FACE);
GL11.glCullFace(GL11.GL_BACK);
}
示例13: onRenderLoad
import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
@Override
protected void onRenderLoad(RenderEngine renderEngine)
{
System.out.println("LOADING");
GL11.glEnable(GL11.GL_CULL_FACE);
GL11.glCullFace(GL11.GL_BACK);
this.renderables = new HashSet<>();
this.renderComponents = new HashSet<>();
final Window window = Cuplet.getCuplet().getWindow();
final AssetManager assets = Cuplet.getCuplet().getAssetManager();
//Camera
this.camera = new OrthographicCamera(window.getWidth(), window.getHeight());
this.screenSpace = new ScreenSpace(window.getView().getCurrentViewPort(), this.camera, Direction.CENTER, Direction.NORTHEAST);
//Assets
assets.registerResourceLocation("bitmap.font", new ResourceLocation("base:font.png"));
//hack to display stuff correctly
//assets.<Bitmap>getAsset("bitmap", "font").get().flipVertically();
//assets.<Bitmap>getAsset("bitmap", "font").get().flipHorizontally();
assets.registerResourceLocation("texture.font", new ResourceLocation("cuplet:texture_font.res"));
assets.registerResourceLocation("texture_atlas.font", new ResourceLocation("cuplet:texture_atlas_font.res"));
assets.registerResourceLocation("program.simple", new ResourceLocation("cuplet:program_simple.res"));
assets.registerResourceLocation("vertex_shader.simple", new ResourceLocation("base:simple.vsh"));
assets.registerResourceLocation("fragment_shader.simple", new ResourceLocation("base:simple.fsh"));
assets.registerResourceLocation("program.wireframe", new ResourceLocation("cuplet:program_wireframe.res"));
assets.registerResourceLocation("vertex_shader.wireframe", new ResourceLocation("base:wireframe.vsh"));
assets.registerResourceLocation("fragment_shader.wireframe", new ResourceLocation("base:wireframe.fsh"));
assets.registerResourceLocation("mesh.quad", new ResourceLocation("lantern:quad.obj"));
//Models
//???
//Materials
//???
//Texture Atlas
{
TextureAtlasBuilder tab = new TextureAtlasBuilder(assets.getAsset("texture", "font"), 256, 256);
tab.addTileSheet(0, 0, 16, 16, 0, 0, 16, 16);
TextureAtlas atlas = tab.bake();
tab.clear();
assets.cacheResource("texture_atlas", "font", atlas);
}
this.fontSheet = new FontSheet(assets.getAsset("texture_atlas", "font"), 0, (char) 0, (char) 255);
//Renderer
this.simpleRenderer = new SimpleRenderer(
assets.getAsset("program", "simple"));
this.collisionBoxRenderer = new CollisionBoxRenderer(
assets.getAsset("program", "wireframe"),
assets.getAsset("mesh", "quad"));
}