hello rectangele
This commit is contained in:
@@ -1,16 +1,30 @@
|
||||
float tri_vertices[] = {-0.5f, -0.5f, 0.0f, 0.5f, -0.5f, 0.0f, 0.0f, 0.5f, 0.0f};
|
||||
|
||||
float sqr_vertices[] = {
|
||||
0.5f, 0.5f, 0.0f, /*top R*/
|
||||
0.5f, -0.5f, 0.0f, /*bottom R*/
|
||||
-0.5f, -0.5f, 0.0f, /*bottom L*/
|
||||
-0.5f, 0.5f, 0.0f/*top R*/
|
||||
};
|
||||
|
||||
unsigned int sqr_indices[] = {
|
||||
0, 1, 3,/*tl triangle*/
|
||||
1, 2, 3 /*br triangle*/
|
||||
};
|
||||
|
||||
const char *basicVertexShaderSource = "#version 330 core\n"
|
||||
"layout (location = 0) in vec3 aPos;\n"
|
||||
"out vec3 color;\n"
|
||||
"void main()\n"
|
||||
"{\n"
|
||||
" color = aPos;"
|
||||
" gl_Position = vec4(aPos.x, aPos.y, aPos.z, 1.0);\n"
|
||||
"}\0";
|
||||
|
||||
const char *basicFragmentShaderSource = "#version 330 core\n"
|
||||
"out vec4 FragColor;\n"
|
||||
"out vec3 FragColor;\n"
|
||||
"in vec3 color;"
|
||||
"void main()\n"
|
||||
"{\n"
|
||||
" FragColor = vec4(1.0f, 0.5f, 0.2f, 1.0f);\n"
|
||||
" FragColor = (color/2+.5)*1.5;\n"
|
||||
"}\n";
|
||||
|
||||
Reference in New Issue
Block a user