Java Code Examples for com.jogamp.opengl.math.FloatUtil#makeOrtho()

The following examples show how to use com.jogamp.opengl.math.FloatUtil#makeOrtho() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: HelloTriangleSimple.java    From hello-triangle with MIT License 6 votes vote down vote up
@Override
public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {

    GL3 gl = drawable.getGL().getGL3();

    float[] ortho = new float[16];
    FloatUtil.makeOrtho(ortho, 0, false, -1, 1, -1, 1, 1, -1);
    for (int i = 0; i < 16; i++) {
        matBuffer.put(i, ortho[i]);
    }
    gl.glBindBuffer(GL_UNIFORM_BUFFER, bufferName.get(Buffer.GLOBAL_MATRICES));
    gl.glBufferSubData(GL_UNIFORM_BUFFER, 0, 16 * Float.BYTES, matBuffer);
    gl.glBindBuffer(GL_UNIFORM_BUFFER, 0);

    gl.glViewport(x, y, width, height);
}
 
Example 2
Source File: HelloTriangleSimple.java    From CPE552-Java with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {

    GL4 gl = drawable.getGL().getGL4();

    // ortho matrix
    float[] ortho = FloatUtil.makeOrtho(new float[16], 0, false, -1f, 1f, -1f, 1f, 1f, -1f);
    globalMatricesPointer.asFloatBuffer().put(ortho);

    gl.glViewport(x, y, width, height);
}
 
Example 3
Source File: HelloTriangleSimple.java    From hello-triangle with MIT License 5 votes vote down vote up
@Override
public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {

    GL4 gl = drawable.getGL().getGL4();

    // ortho matrix
    float[] ortho = FloatUtil.makeOrtho(new float[16], 0, false, -1f, 1f, -1f, 1f, 1f, -1f);
    globalMatricesPointer.asFloatBuffer().put(ortho);

    gl.glViewport(x, y, width, height);
}