forked from BSVino/docs.gl
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
23 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// The index returned from these GLint functions gets passed to {%glEnableVertexAttribArray} during rendering. | ||
GLint position_attrib_index = {%glGetAttribLocation}(program, "position"); // program is what is returned by {%glCreateProgram}. | ||
GLint texcoord_attrib_index = {%glGetAttribLocation}(program, "texcoord"); | ||
GLint normal_attrib_index = {%glGetAttribLocation}(program, "normal"); | ||
GLint color_attrib_index = {%glGetAttribLocation}(program, "color"); | ||
|
||
{%glBindFragDataLocation}(program, 0, "output_color"); // "output_color" is an output value in your vertex shader and an input value in your fragment shader. | ||
|
||
GLint num_uniforms; | ||
{%glGetProgramiv}(program, GL_ACTIVE_UNIFORMS, &num_uniforms); | ||
GLchar uniform_name[256]; | ||
GLsizei length; | ||
GLint size; | ||
GLenum type; | ||
for (int i = 0; i < num_uniforms; i++) | ||
{ | ||
{%glGetActiveUniform}(program, i, sizeof(uniform_name), &length, &size, &type, uniform_name); | ||
// ... save this uniform data so it can be used during rendering | ||
} |
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