Creating a triangle with OpenGL & GLSL
I'm trying to get a triangle on screen. The code works except there is no
triangle. I'm using simple pass-trough shaders to achieve this goal.
Vertex shader:
const char *vertexShader = {
"#version 150\n"
"in vec3 vPos;"
"uniform mat4 projection_matrix;"
"void main(){"
" gl_Position = vec4(vPos,1.0);"
"}"
};
Fragment shader:
const char *fragmentShader = {
"#version 150\n"
"out vec4 fColor;"
"void main(){"
" fColor = vec4(1.0,0.0,0.0,1.0);"
"}"
};
Code: http://bobdolman.com/code.html
No comments:
Post a Comment