浏览代码

upped cmake requirement to match C++11 support

naelstrof 8 年前
父节点
当前提交
a65667346c
共有 3 个文件被更改,包括 17 次插入5 次删除
  1. 4
    3
      CMakeLists.txt
  2. 4
    1
      README.md
  3. 9
    1
      shaderexamples/blur1.frag

+ 4
- 3
CMakeLists.txt 查看文件

1
-cmake_minimum_required(VERSION 2.6)
1
+cmake_minimum_required(VERSION 3.1.3)
2
 
2
 
3
 set(CMAKE_BUILD_TYPE Debug CACHE STRING "Choose the type of build (Debug or Release)")
3
 set(CMAKE_BUILD_TYPE Debug CACHE STRING "Choose the type of build (Debug or Release)")
4
 if ( NOT CMAKE_INSTALL_PREFIX )
4
 if ( NOT CMAKE_INSTALL_PREFIX )
21
 
21
 
22
 include_directories("${PROJECT_BINARY_DIR}")
22
 include_directories("${PROJECT_BINARY_DIR}")
23
 
23
 
24
-add_definitions(-DSLOP_VERSION="v5.3.36")
24
+add_definitions(-DSLOP_VERSION="v5.3.37")
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")
41
                                     src/xshaperectangle.cpp
41
                                     src/xshaperectangle.cpp
42
                                     src/glrectangle.cpp)
42
                                     src/glrectangle.cpp)
43
 
43
 
44
-set_property(TARGET ${LIBRARY_NAME} PROPERTY CXX_STANDARD 11)
45
 set_property(TARGET ${LIBRARY_NAME} PROPERTY CXX_STANDARD_REQUIRED ON)
44
 set_property(TARGET ${LIBRARY_NAME} PROPERTY CXX_STANDARD_REQUIRED ON)
45
+set_property(TARGET ${LIBRARY_NAME} PROPERTY CXX_STANDARD 11)
46
 
46
 
47
 add_executable(${EXECUTABLE_NAME} src/options.cpp
47
 add_executable(${EXECUTABLE_NAME} src/options.cpp
48
                                   src/main.cpp)
48
                                   src/main.cpp)
49
 
49
 
50
+set_property(TARGET ${EXECUTABLE_NAME} PROPERTY CXX_STANDARD_REQUIRED ON)
50
 set_property(TARGET ${EXECUTABLE_NAME} PROPERTY CXX_STANDARD 11)
51
 set_property(TARGET ${EXECUTABLE_NAME} PROPERTY CXX_STANDARD 11)
51
 
52
 
52
 set( CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/modules" )
53
 set( CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/modules" )

+ 4
- 1
README.md 查看文件

87
 
87
 
88
 The files listed to the right of the `|` are the required files for the command to the left to work correctly.
88
 The files listed to the right of the `|` are the required files for the command to the left to work correctly.
89
 * `slop -rblur1,blur2 -b100` | `~/.config/slop/{blur1,blur2}{.frag,.vert}`
89
 * `slop -rblur1,blur2 -b100` | `~/.config/slop/{blur1,blur2}{.frag,.vert}`
90
+
90
 ![slop blur](https://my.mixtape.moe/bvsrzr.png)
91
 ![slop blur](https://my.mixtape.moe/bvsrzr.png)
91
 
92
 
92
 * `slop -rwiggle -b10` | `~/.config/slop/wiggle{.frag,.vert}`
93
 * `slop -rwiggle -b10` | `~/.config/slop/wiggle{.frag,.vert}`
94
+
93
 ![slop animation](http://i.giphy.com/12vjSbFZ0CWDW8.gif)
95
 ![slop animation](http://i.giphy.com/12vjSbFZ0CWDW8.gif)
94
 
96
 
95
 And all together now...
97
 And all together now...
96
-
97
 * `slop -rblur1,blur2,wiggle -b50 -c1,1,1` | `~/.config/slop/{blur1,blur2,wiggle}{.frag,.vert}`
98
 * `slop -rblur1,blur2,wiggle -b50 -c1,1,1` | `~/.config/slop/{blur1,blur2,wiggle}{.frag,.vert}`
99
+
98
 ![slop animation](http://i.giphy.com/kfBLafeJfLs2Y.gif)
100
 ![slop animation](http://i.giphy.com/kfBLafeJfLs2Y.gif)
99
 
101
 
100
 Finally here's an example of a magnifying glass.
102
 Finally here's an example of a magnifying glass.
101
 * `slop -rcrosshair` | `~/.config/slop/crosshair{.frag,.vert}`
103
 * `slop -rcrosshair` | `~/.config/slop/crosshair{.frag,.vert}`
104
+
102
 ![slop animation](http://i.giphy.com/2xy0fC2LOFQfm.gif)
105
 ![slop animation](http://i.giphy.com/2xy0fC2LOFQfm.gif)
103
 
106
 
104
 It's fairly easy to adjust how the shaders work by editing them with your favourite text editor. Or even make your own!
107
 It's fairly easy to adjust how the shaders work by editing them with your favourite text editor. Or even make your own!

+ 9
- 1
shaderexamples/blur1.frag 查看文件

22
     color += texture2D(desktop, upsideDownUV - (off2 / screenSize)) * 0.09447039785044732;
22
     color += texture2D(desktop, upsideDownUV - (off2 / screenSize)) * 0.09447039785044732;
23
     color += texture2D(desktop, upsideDownUV + (off3 / screenSize)) * 0.010381362401148057;
23
     color += texture2D(desktop, upsideDownUV + (off3 / screenSize)) * 0.010381362401148057;
24
     color += texture2D(desktop, upsideDownUV - (off3 / screenSize)) * 0.010381362401148057;
24
     color += texture2D(desktop, upsideDownUV - (off3 / screenSize)) * 0.010381362401148057;
25
-    gl_FragColor = (texture2D(texture, uvCoord) * color);
25
+    vec4 tcolor = vec4(0.0);
26
+    tcolor += texture2D(texture, uvCoord) * 0.1964825501511404;
27
+    tcolor += texture2D(texture, uvCoord + (off1 / screenSize)) * 0.2969069646728344;
28
+    tcolor += texture2D(texture, uvCoord - (off1 / screenSize)) * 0.2969069646728344;
29
+    tcolor += texture2D(texture, uvCoord + (off2 / screenSize)) * 0.09447039785044732;
30
+    tcolor += texture2D(texture, uvCoord - (off2 / screenSize)) * 0.09447039785044732;
31
+    tcolor += texture2D(texture, uvCoord + (off3 / screenSize)) * 0.010381362401148057;
32
+    tcolor += texture2D(texture, uvCoord - (off3 / screenSize)) * 0.010381362401148057;
33
+    gl_FragColor = (tcolor * color);
26
 }
34
 }