20 s->
pt = glGetAttribLocation(s->
program,
"pt");
D;
24 glGenVertexArrays(1, &s->
vao);
D;
25 glGenVertexArrays(1, &s->
vao2);
D;
26 glGenBuffers(1, &s->
vbo);
D;
33 glBindBuffer(GL_ARRAY_BUFFER, s->
vbo);
D;
34 glBufferData(GL_ARRAY_BUFFER, 16 *
sizeof(GLfloat), &quad, GL_STATIC_DRAW);
D;
35 glBindVertexArray(s->
vao);
D;
36 glVertexAttribPointer(s->
pt, 4, GL_FLOAT, GL_FALSE, 0, 0);
D;
37 glEnableVertexAttribArray(s->
pt);
D;
38 glBindVertexArray(s->
vao2);
D;
39 glVertexAttribPointer(s->
pt2, 4, GL_FLOAT, GL_FALSE, 0, 0);
D;
40 glEnableVertexAttribArray(s->
pt2);
D;
41 glBindVertexArray(0);
D;
42 glBindBuffer(GL_ARRAY_BUFFER, 0);
D;
50 glGenFramebuffers(1, &s->
fbo);
D;
51 glBindFramebuffer(GL_FRAMEBUFFER, s->
fbo);
D;
52 glFramebufferTexture(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, rgb_tex, 0);
D;
53 GLenum buffers[1] = { GL_COLOR_ATTACHMENT0 };
54 glDrawBuffers(1, buffers);
D;
55 glBindFramebuffer(GL_FRAMEBUFFER, 0);
D;
61 glDeleteVertexArrays(1, &s->
vao);
D;
62 glDeleteVertexArrays(1, &s->
vao2);
D;
63 glDeleteBuffers(1, &s->
vbo);
D;
64 glDeleteFramebuffers(1, &s->
fbo);
D;
72 void fp32_colour_do(
struct fp32_colour *s,
int win_width,
int win_height,
int width,
int height,
bool update,
bool update2, GLuint errs,
float thickness,
int slice,
int slice_n) {
74 glBindFramebuffer(GL_FRAMEBUFFER, s->
fbo);
D;
75 glViewport(0, 0, width, height);
D;
77 glUniform1i(s->
update, update);
D;
79 glUniform1i(s->
errs, errs);
D;
81 glUniform2i(s->
slicing, slice_n, slice);
82 glBindVertexArray(s->
vao);
D;
83 glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
D;
84 glBindVertexArray(0);
D;
86 glBindFramebuffer(GL_FRAMEBUFFER, 0);
D;
87 glActiveTexture(GL_TEXTURE0 +
TEX_RGB);
D;
88 glGenerateMipmap(GL_TEXTURE_2D);
D;
90 glViewport(0, 0, win_width, win_height);
D;
92 glBindVertexArray(s->
vao2);
D;
93 glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
D;
94 glBindVertexArray(0);
D;
96 glViewport(0, 0, width, height);
D;
100 glBindFramebuffer(GL_FRAMEBUFFER, s->
fbo);
D;
101 glViewport(0, 0, width, height);
D;
102 glClearColor(1.0, 0.7, 0.0, 1.0);
D;
103 glClear(GL_COLOR_BUFFER_BIT);
D;
104 glBindFramebuffer(GL_FRAMEBUFFER, 0);
D;