Example usage for org.lwjgl.opengl GL11 glMatrixMode

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

Introduction

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

Prototype

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

Source Link

Document

Set the current matrix mode.

Usage

From source file:com.rvantwisk.cnctools.opengl.View2D.java

License:Open Source License

@Override
public void begin() {
    GL11.glMatrixMode(GL11.GL_PROJECTION);
    GL11.glPushMatrix();// ww w  . j a v a2s .c o  m
    GL11.glLoadIdentity();

    GL11.glOrtho(0, camera.getWidth(), 0, camera.getHeight(), NEAR, FAR);

    GL11.glMatrixMode(GL11.GL_MODELVIEW);
    GL11.glPushMatrix();
    GL11.glLoadIdentity();
}

From source file:com.rvantwisk.cnctools.opengl.View2D.java

License:Open Source License

@Override
public void end() {
    GL11.glMatrixMode(GL11.GL_PROJECTION);
    GL11.glPopMatrix();
    GL11.glMatrixMode(GL11.GL_MODELVIEW);
    GL11.glPopMatrix();
}

From source file:com.rvantwisk.cnctools.opengl.View2D.java

License:Open Source License

@Override
public void display_transform() {

    // _center_on_origin
    GL11.glMatrixMode(GL11.GL_PROJECTION);
    GL11.glLoadIdentity();//from  w ww . j  a  v  a2 s. c om
    GL11.glOrtho(-camera.getX(), camera.getX(), -camera.getY(), camera.getY(), NEAR, FAR);
    GL11.glMatrixMode(GL11.GL_MODELVIEW);
    // _center_on_origin

    GL11.glTranslatef(camera.getX(), camera.getY(), camera.getZ());
    GL11.glRotatef(camera.getAzimuth(), 0.0f, 0.0f, 1.0f);
    GL11.glScalef(camera.getZoom_factor(), camera.getZoom_factor(), camera.getZoom_factor());
}

From source file:com.rvantwisk.cnctools.opengl.View3D.java

License:Open Source License

@Override
public void begin() {
    GL11.glMatrixMode(GL11.GL_PROJECTION);
    GL11.glPushMatrix();/* www.  j a  v a  2 s  . c  om*/
    GL11.glLoadIdentity();

    if (camera.isOrtho()) {
        GL11.glOrtho(-camera.getX(), camera.getX(), -camera.getY(), camera.getY(), -NEAR, FAR);
    } else {
        GLU.gluPerspective(camera.getFOVY(), camera.getWidth() / camera.getHeight(), NEAR, FAR);
    }

    GL11.glMatrixMode(GL11.GL_MODELVIEW);
    GL11.glPushMatrix();
    GL11.glLoadIdentity();
}

From source file:com.samrj.devil.graphics.Camera2D.java

public static void glLoadScreen(int resX, int resY) {
    GL11.glMatrixMode(GL11.GL_PROJECTION);
    GL11.glLoadIdentity();//from   w w w.  j a v a 2 s .  c o  m
    GL11.glOrtho(0f, resX, 0f, resY, -1f, 1f);
    GL11.glMatrixMode(GL11.GL_MODELVIEW);
    GL11.glLoadIdentity();
}

From source file:com.samrj.devil.graphics.Camera2D.java

public static void glLoadIdentity() {
    GL11.glMatrixMode(GL11.GL_PROJECTION);
    GL11.glLoadIdentity();
    GL11.glMatrixMode(GL11.GL_MODELVIEW);
    GL11.glLoadIdentity();
}

From source file:com.samrj.devil.graphics.GraphicsUtil.java

public static void glLoadMatrix(Mat3 m, int mode) {
    long address = mat3As4(m);
    GL11.glMatrixMode(mode);
    GL11.nglLoadMatrixf(address);// w w w  . java2s . c o  m
    MemStack.pop();
}

From source file:com.samrj.devil.graphics.GraphicsUtil.java

public static void glMultMatrix(Mat3 m, int mode) {
    long address = mat3As4(m);
    GL11.glMatrixMode(mode);
    GL11.nglMultMatrixf(address);/*from w  w  w  . java2s.c  om*/
    MemStack.pop();
}

From source file:com.samrj.devil.graphics.GraphicsUtil.java

public static void glLoadMatrix(Mat4 m, int mode) {
    long address = MemStack.wrap(m);
    GL11.glMatrixMode(mode);
    GL11.nglLoadMatrixf(address);//from   w  w w .  j  a  v a2  s  . c o m
    MemStack.pop();
}

From source file:com.samrj.devil.graphics.GraphicsUtil.java

public static void glMultMatrix(Mat4 m, int mode) {
    long address = MemStack.wrap(m);
    GL11.glMatrixMode(mode);
    GL11.nglMultMatrixf(address);/*from   ww  w  . j  a va 2 s  .  co m*/
    MemStack.pop();
}