浏览代码

now clearing all buffers

naelstrof 7 年前
父节点
当前提交
9df78697d9
共有 3 个文件被更改,包括 6 次插入1 次删除
  1. 1
    1
      CMakeLists.txt
  2. 3
    0
      src/framebuffer.cpp
  3. 2
    0
      src/slop.cpp

+ 1
- 1
CMakeLists.txt 查看文件

@@ -21,7 +21,7 @@ endif()
21 21
 
22 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 26
 # The names have to be unique unfortunately.
27 27
 set(EXECUTABLE_NAME "slop")

+ 3
- 0
src/framebuffer.cpp 查看文件

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

+ 2
- 0
src/slop.cpp 查看文件

@@ -175,6 +175,8 @@ slop::SlopSelection slop::GLSlopSelect( slop::SlopOptions* options, bool* cancel
175 175
         window->framebuffer->unbind();
176 176
 
177 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 180
         window->framebuffer->draw();
179 181
         window->display();
180 182
         GLenum err = glGetError();