Browse Source

upped cmake requirement to match C++11 support

naelstrof 7 years ago
parent
commit
a65667346c
3 changed files with 17 additions and 5 deletions
  1. 4
    3
      CMakeLists.txt
  2. 4
    1
      README.md
  3. 9
    1
      shaderexamples/blur1.frag

+ 4
- 3
CMakeLists.txt View File

@@ -1,4 +1,4 @@
1
-cmake_minimum_required(VERSION 2.6)
1
+cmake_minimum_required(VERSION 3.1.3)
2 2
 
3 3
 set(CMAKE_BUILD_TYPE Debug CACHE STRING "Choose the type of build (Debug or Release)")
4 4
 if ( NOT CMAKE_INSTALL_PREFIX )
@@ -21,7 +21,7 @@ endif()
21 21
 
22 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 26
 # The names have to be unique unfortunately.
27 27
 set(EXECUTABLE_NAME "slop")
@@ -41,12 +41,13 @@ add_library(${LIBRARY_NAME} SHARED  src/mouse.cpp
41 41
                                     src/xshaperectangle.cpp
42 42
                                     src/glrectangle.cpp)
43 43
 
44
-set_property(TARGET ${LIBRARY_NAME} PROPERTY CXX_STANDARD 11)
45 44
 set_property(TARGET ${LIBRARY_NAME} PROPERTY CXX_STANDARD_REQUIRED ON)
45
+set_property(TARGET ${LIBRARY_NAME} PROPERTY CXX_STANDARD 11)
46 46
 
47 47
 add_executable(${EXECUTABLE_NAME} src/options.cpp
48 48
                                   src/main.cpp)
49 49
 
50
+set_property(TARGET ${EXECUTABLE_NAME} PROPERTY CXX_STANDARD_REQUIRED ON)
50 51
 set_property(TARGET ${EXECUTABLE_NAME} PROPERTY CXX_STANDARD 11)
51 52
 
52 53
 set( CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/modules" )

+ 4
- 1
README.md View File

@@ -87,18 +87,21 @@ Enough chatting about it though, here's some example shaders you can copy from [
87 87
 
88 88
 The files listed to the right of the `|` are the required files for the command to the left to work correctly.
89 89
 * `slop -rblur1,blur2 -b100` | `~/.config/slop/{blur1,blur2}{.frag,.vert}`
90
+
90 91
 ![slop blur](https://my.mixtape.moe/bvsrzr.png)
91 92
 
92 93
 * `slop -rwiggle -b10` | `~/.config/slop/wiggle{.frag,.vert}`
94
+
93 95
 ![slop animation](http://i.giphy.com/12vjSbFZ0CWDW8.gif)
94 96
 
95 97
 And all together now...
96
-
97 98
 * `slop -rblur1,blur2,wiggle -b50 -c1,1,1` | `~/.config/slop/{blur1,blur2,wiggle}{.frag,.vert}`
99
+
98 100
 ![slop animation](http://i.giphy.com/kfBLafeJfLs2Y.gif)
99 101
 
100 102
 Finally here's an example of a magnifying glass.
101 103
 * `slop -rcrosshair` | `~/.config/slop/crosshair{.frag,.vert}`
104
+
102 105
 ![slop animation](http://i.giphy.com/2xy0fC2LOFQfm.gif)
103 106
 
104 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 View File

@@ -22,5 +22,13 @@ void main()
22 22
     color += texture2D(desktop, upsideDownUV - (off2 / screenSize)) * 0.09447039785044732;
23 23
     color += texture2D(desktop, upsideDownUV + (off3 / screenSize)) * 0.010381362401148057;
24 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
 }