This file contains 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
gl_Position = (ProjectionMatrix * ViewMatrix * ModelMatrix) * in_Position; |
This file contains 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
uniform mat4 ModelMatrix; | |
uniform mat4 ViewMatrix; | |
uniform mat4 ProjectionMatrix; |
This file contains 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
GLuint LoadShader(const char* filename, GLenum shader_type); |
This file contains 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
float Identity[16] = { | |
1, 0, 0, 0, | |
0, 1, 0, 0, | |
0, 0, 1, 0, | |
0, 0, 0, 1 | |
}; |
This file contains 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
float Identity[16] = { 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1 }; |
This file contains 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
void glUniformMatrix4fv( | |
Glint location, | |
GLsizei count, | |
GLboolean transpose, | |
const GLfloat* value | |
); |
This file contains 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
GLint glGetUniformLocation(GLuint program, const GLchar* name); |
This file contains 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
#version 400 | |
in vec4 ex_Color; | |
out vec4 out_Color; | |
void main(void) | |
{ | |
out_Color = ex_Color; | |
} |
This file contains 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
#version 400 | |
layout(location=0) in vec4 in_Position; | |
layout(location=1) in vec4 in_Color; | |
out vec4 ex_Color; | |
uniform mat4 ModelMatrix; | |
uniform mat4 ViewMatrix; | |
uniform mat4 ProjectionMatrix; |
This file contains 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
glBindVertexArray(BufferIds[0]); | |
ExitOnGLError("ERROR: Could not bind the VAO for drawing purposes"); | |
glDrawElements(GL_TRIANGLES, 36, GL_UNSIGNED_INT, (GLvoid*)0); | |
ExitOnGLError("ERROR: Could not draw the cube"); | |
glBindVertexArray(0); | |
glUseProgram(0); |