Skip to content

Instantly share code, notes, and snippets.

View EddyLuten's full-sized avatar

Eddy Luten EddyLuten

View GitHub Profile
@EddyLuten
EddyLuten / chapter.4.37.c
Created May 20, 2014 04:02
Chapter 4, Snippet 37 - OpenGLBook.com
gl_Position = (ProjectionMatrix * ViewMatrix * ModelMatrix) * in_Position;
@EddyLuten
EddyLuten / chapter.4.36.c
Created May 20, 2014 04:02
Chapter 4, Snippet 36 - OpenGLBook.com
uniform mat4 ModelMatrix;
uniform mat4 ViewMatrix;
uniform mat4 ProjectionMatrix;
@EddyLuten
EddyLuten / chapter.4.35.c
Created May 20, 2014 04:00
Chapter 4, Snippet 35 - OpenGLBook.com
GLuint LoadShader(const char* filename, GLenum shader_type);
@EddyLuten
EddyLuten / chapter.4.34.c
Created May 20, 2014 03:52
Chapter 4, Snippet 34 - OpenGLBook.com
float Identity[16] = {
1, 0, 0, 0,
0, 1, 0, 0,
0, 0, 1, 0,
0, 0, 0, 1
};
@EddyLuten
EddyLuten / chapter.4.33.c
Created May 20, 2014 03:50
Chapter 4, Snippet 33 - OpenGLBook.com
float Identity[16] = { 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1 };
@EddyLuten
EddyLuten / chapter.4.32.c
Created May 20, 2014 03:49
Chapter 4, Snippet 32 - OpenGLBook.com
void glUniformMatrix4fv(
Glint location,
GLsizei count,
GLboolean transpose,
const GLfloat* value
);
@EddyLuten
EddyLuten / chapter.4.31.c
Created May 20, 2014 03:47
Chapter 4, Snippet 31 - OpenGLBook.com
GLint glGetUniformLocation(GLuint program, const GLchar* name);
@EddyLuten
EddyLuten / chapter.4.30.glsl
Created May 20, 2014 03:43
Chapter 4, Snippet 30 - OpenGLBook.com
#version 400
in vec4 ex_Color;
out vec4 out_Color;
void main(void)
{
out_Color = ex_Color;
}
@EddyLuten
EddyLuten / chapter.4.29.glsl
Created May 20, 2014 03:42
Chapter 4, Snippet 29 - OpenGLBook.com
#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;
@EddyLuten
EddyLuten / chapter.4.28.c
Created May 20, 2014 03:41
Chapter 4, Snippet 18 - OpenGLBook.com
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);