Example usage for org.lwjgl.opengl GL11 glShadeModel

List of usage examples for org.lwjgl.opengl GL11 glShadeModel

Introduction

In this page you can find the example usage for org.lwjgl.opengl GL11 glShadeModel.

Prototype

public static native void glShadeModel(@NativeType("GLenum") int mode);

Source Link

Document

Sets the current shade mode.

Usage

From source file:zildo.platform.opengl.LwjglOpenGLGestion.java

License:Open Source License

private void initGL() {
    GL11.glEnable(GL11.GL_TEXTURE_2D); // Enable Texture Mapping
    GL11.glShadeModel(GL11.GL_SMOOTH); // Enable Smooth Shading
    GL11.glClearColor(0.0f, 0.0f, 0.0f, 0.0f); // Black Background
    GL11.glClearDepth(1.0f); // Depth Buffer Setup
    GL11.glEnable(GL11.GL_DEPTH_TEST); // Enables Depth Testing
    GL11.glDepthFunc(GL11.GL_LEQUAL); // The Type Of Depth Testing To Do

    // initProjectionScene();

    GL11.glEnable(GL11.GL_CULL_FACE);// www.j  a v  a2  s  .  c om

    ByteBuffer temp = ByteBuffer.allocateDirect(16);
    temp.order(ByteOrder.nativeOrder());
    GL11.glLight(GL11.GL_LIGHT1, GL11.GL_AMBIENT, (FloatBuffer) temp.asFloatBuffer().put(lightAmbient).flip()); // Setup The Ambient
                                                                                                                // Light
    GL11.glLight(GL11.GL_LIGHT1, GL11.GL_DIFFUSE, (FloatBuffer) temp.asFloatBuffer().put(lightDiffuse).flip()); // Setup The Diffuse
                                                                                                                // Light
    GL11.glLight(GL11.GL_LIGHT1, GL11.GL_POSITION,
            (FloatBuffer) temp.asFloatBuffer().put(lightPosition).flip()); // Position The
                                                                                                                          // Light
    GL11.glEnable(GL11.GL_LIGHT1); // Enable Light One

    // GL11.glEnable(GL11.GL_LIGHTING);

    Display.setVSyncEnabled(true);

}