Browse Source

now clearing all buffers

naelstrof 7 years ago
parent
commit
9df78697d9
3 changed files with 6 additions and 1 deletions
  1. 1
    1
      CMakeLists.txt
  2. 3
    0
      src/framebuffer.cpp
  3. 2
    0
      src/slop.cpp

+ 1
- 1
CMakeLists.txt View File

21
 
21
 
22
 include_directories("${PROJECT_BINARY_DIR}")
22
 include_directories("${PROJECT_BINARY_DIR}")
23
 
23
 
24
-add_definitions(-DSLOP_VERSION="v5.3.23")
24
+add_definitions(-DSLOP_VERSION="v5.3.24")
25
 
25
 
26
 # The names have to be unique unfortunately.
26
 # The names have to be unique unfortunately.
27
 set(EXECUTABLE_NAME "slop")
27
 set(EXECUTABLE_NAME "slop")

+ 3
- 0
src/framebuffer.cpp View File

73
 }
73
 }
74
 
74
 
75
 void slop::Framebuffer::draw(){
75
 void slop::Framebuffer::draw(){
76
+    glEnable( GL_BLEND );
77
+    glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
76
     shader->bind();
78
     shader->bind();
77
     shader->setParameter( "texture", 0 );
79
     shader->setParameter( "texture", 0 );
78
     shader->setAttribute( "position", buffers[0], 2 );
80
     shader->setAttribute( "position", buffers[0], 2 );
82
     glEnable( GL_TEXTURE_2D );
84
     glEnable( GL_TEXTURE_2D );
83
     glDrawArrays( GL_TRIANGLES, 0, vertCount );
85
     glDrawArrays( GL_TRIANGLES, 0, vertCount );
84
     glDisable( GL_TEXTURE_2D );
86
     glDisable( GL_TEXTURE_2D );
87
+    glDisable( GL_BLEND );
85
     shader->unbind();
88
     shader->unbind();
86
 }
89
 }

+ 2
- 0
src/slop.cpp View File

175
         window->framebuffer->unbind();
175
         window->framebuffer->unbind();
176
 
176
 
177
         // Then we draw the framebuffer to the screen
177
         // Then we draw the framebuffer to the screen
178
+        glClearColor (0.0, 0.0, 0.0, 0.0);
179
+        glClear (GL_COLOR_BUFFER_BIT);
178
         window->framebuffer->draw();
180
         window->framebuffer->draw();
179
         window->display();
181
         window->display();
180
         GLenum err = glGetError();
182
         GLenum err = glGetError();