further cleanup
This commit is contained in:
parent
075d18b4b8
commit
05dea19436
8 changed files with 54 additions and 25 deletions
|
@ -42,7 +42,7 @@ struct triangle_renderer
|
|||
glBindVertexArray(vao);
|
||||
glEnableVertexAttribArray(0);
|
||||
glBindBuffer(GL_ARRAY_BUFFER, vbo);
|
||||
glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 0, NULL);
|
||||
glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 0, nullptr);
|
||||
|
||||
const char* vertex_shader =
|
||||
"#version 400\n"
|
||||
|
@ -56,7 +56,7 @@ struct triangle_renderer
|
|||
"#version 400\n"
|
||||
"out vec4 frag_colour;"
|
||||
"void main() {"
|
||||
" frag_colour = vec4(0.5, 0.0, 0.5, 1.0);"
|
||||
" frag_colour = vec4(0.1, 0.0, 0.5, 1.0);"
|
||||
"}";
|
||||
#if 0
|
||||
GLuint vs = glCreateShader(GL_VERTEX_SHADER);
|
||||
|
@ -185,10 +185,13 @@ bool pipeline::impl::create(sizei size)
|
|||
void pipeline::impl::draw()
|
||||
{
|
||||
|
||||
glClearColor(0,0,0,1);
|
||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||
|
||||
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, _fbo_msaa);
|
||||
|
||||
glClearColor(1,0,0,1);
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
glClearColor(1,1,1,1);
|
||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||
|
||||
tr.draw();
|
||||
|
||||
|
@ -225,7 +228,12 @@ void pipeline::impl::draw()
|
|||
GL_COLOR_BUFFER_BIT, // buffer mask
|
||||
GL_LINEAR); // scale filter
|
||||
|
||||
debug::d() << _size.width << "x" << _size.height;
|
||||
|
||||
|
||||
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);
|
||||
glBindFramebuffer(GL_READ_FRAMEBUFFER, 0);
|
||||
|
||||
// debug::d() << _size.width << "x" << _size.height;
|
||||
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue