Skip to content

Instantly share code, notes, and snippets.

@matyklug18
Last active January 30, 2020 17:45
Show Gist options
  • Save matyklug18/faf6e31484db31a91c9fd78dacefafa7 to your computer and use it in GitHub Desktop.
Save matyklug18/faf6e31484db31a91c9fd78dacefafa7 to your computer and use it in GitHub Desktop.
projectionMatrix = new Matrix4f().ortho(0, win.getH(), 0 , win.getW(), Z_NEAR, Z_FAR);
setUniform("project", projectionMatrix);
private void setUniform(String name, Matrix4f matrix) {
FloatBuffer matrixB = MemoryUtil.memAllocFloat(16);
matrix.get(matrixB);
glUniformMatrix4fv(glGetUniformLocation(PID, name), false, matrixB);
}
String VF = "#version 330 core\n" +
"in vec3 position;\n" +
"uniform mat4 model;\n"+
"void main() {\n" +
"\tgl_Position = project * vec4(position, 1.0);\n" +
"}";
String FF = "#version 330 core\n" +
"out vec4 outColor;\n" +
"void main() {\n" +
"\toutColor = vec4(1);\n" +
"}";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment