File: gltest_data.inl

package info (click to toggle)
glbinding 2.1.1-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 20,848 kB
  • ctags: 30,258
  • sloc: cpp: 255,369; xml: 46,343; python: 7,876; sh: 599; makefile: 494
file content (44 lines) | stat: -rw-r--r-- 681 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44

struct vec2
{
    float x;
    float y;
};

const vec2 vertices[4] = { { +1.f, -1.f }, { +1.f, +1.f }, { -1.f, -1.f }, { -1.f, +1.f } };

const GLchar * vert = R"(
#version 150
#extension GL_ARB_explicit_attrib_location : require

layout (location = 0) in vec2 a_vertex;

out vec4 color;

void main()
{
    gl_Position = vec4(a_vertex, 0.0, 1.0);
    color = vec4(a_vertex * 0.5 + 0.5, 0.0, 1.0);
}
)";

const GLchar * frag = R"(
#version 150
#extension GL_ARB_explicit_attrib_location : require

layout (location = 0) out vec4 fragColor;

in vec4 color;

void main()
{
    fragColor = color;
}
)";

GLuint vao;
GLuint quad;
GLuint program;
GLuint vs;
GLuint fs;
GLuint a_vertex;