Last active
January 30, 2020 17:45
-
-
Save matyklug18/faf6e31484db31a91c9fd78dacefafa7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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