Added texture sqr
This commit is contained in:
@@ -18,6 +18,14 @@ unsigned int sqr_indices[] = {
|
||||
1, 2, 3 /*br triangle*/
|
||||
};
|
||||
|
||||
float sqr_tex_vertices[] = {
|
||||
/*positions*colors*texture coords*/
|
||||
0.5f, 0.5f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f, 1.0f, /*top right*/
|
||||
0.5f, -0.5f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, 0.0f, /*bottom right*/
|
||||
-0.5f, -0.5f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, /*bottom left*/
|
||||
-0.5f, 0.5f, 0.0f, 1.0f, 1.0f, 0.0f, 0.0f, 1.0f /*top left*/
|
||||
};
|
||||
|
||||
const char *basicVertexShaderSource =
|
||||
"#version 330 core\n"
|
||||
"layout (location = 0) in vec3 aPos;\n"
|
||||
@@ -55,11 +63,12 @@ const char *rgbFragmentShaderSource = "#version 330 core\n"
|
||||
" FragColor = vec4(color, 1.0);\n"
|
||||
"}\0";
|
||||
|
||||
const char *rgbPulseFragmentShaderSource = "#version 330 core\n"
|
||||
"out vec4 FragColor;\n"
|
||||
"in vec3 color;\n"
|
||||
"uniform float u_time;"
|
||||
"void main()\n"
|
||||
"{\n"
|
||||
" FragColor = vec4(color,0.0)*(sin(u_time)/2.0+0.5);\n"
|
||||
"}\0";
|
||||
const char *rgbPulseFragmentShaderSource =
|
||||
"#version 330 core\n"
|
||||
"out vec4 FragColor;\n"
|
||||
"in vec3 color;\n"
|
||||
"uniform float u_time;"
|
||||
"void main()\n"
|
||||
"{\n"
|
||||
" FragColor = vec4(color,0.0)*(sin(u_time)/2.0+0.5);\n"
|
||||
"}\0";
|
||||
|
||||
Reference in New Issue
Block a user