diff options
author | James Cowgill <james410@cowgill.org.uk> | 2014-05-07 16:44:27 +0100 |
---|---|---|
committer | James Cowgill <james410@cowgill.org.uk> | 2014-05-07 16:44:27 +0100 |
commit | dd835931261c340acd5f0409341d13fa2670423e (patch) | |
tree | efbea5d72599cb521310adb5201699d39f55e2a4 | |
parent | 86a46b167a63f153fd2e3210092f70d1fef8e232 (diff) |
Imported Upstream version 2.1+dfsg2
21 files changed, 145 insertions, 0 deletions
diff --git a/examples/cocoa/resources/Cocoa-Info.plist b/examples/cocoa/resources/Cocoa-Info.plist new file mode 100644 index 0000000..3ba45e1 --- /dev/null +++ b/examples/cocoa/resources/Cocoa-Info.plist @@ -0,0 +1,34 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> +<dict> + <key>CFBundleDevelopmentRegion</key> + <string>en</string> + <key>CFBundleExecutable</key> + <string>cocoa</string> + <key>CFBundleIconFile</key> + <string>icon.icns</string> + <key>CFBundleIdentifier</key> + <string>org.sfml-dev.cocoa</string> + <key>CFBundleInfoDictionaryVersion</key> + <string>6.0</string> + <key>CFBundleName</key> + <string>cocoa</string> + <key>CFBundlePackageType</key> + <string>APPL</string> + <key>CFBundleShortVersionString</key> + <string>1.0</string> + <key>CFBundleSignature</key> + <string>????</string> + <key>CFBundleVersion</key> + <string>1</string> + <key>LSMinimumSystemVersion</key> + <string>10.6</string> + <key>NSHumanReadableCopyright</key> + <string>Copyright © 2007-2012 Marco Antognini and Laurent Gomila. Shared under zlib/libpng License.</string> + <key>NSMainNibFile</key> + <string>MainMenu</string> + <key>NSPrincipalClass</key> + <string>NSApplication</string> +</dict> +</plist> diff --git a/examples/cocoa/resources/Credits.rtf b/examples/cocoa/resources/Credits.rtf new file mode 100644 index 0000000..53942fc --- /dev/null +++ b/examples/cocoa/resources/Credits.rtf @@ -0,0 +1,7 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf230 +{\fonttbl\f0\fswiss\fcharset0 Helvetica;} +{\colortbl;\red255\green255\blue255;} +\paperw11900\paperh16840\vieww9600\viewh8400\viewkind0 +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardirnatural\qj + +\f0\fs24 \cf0 See {\field{\*\fldinst{HYPERLINK "http://sfml-dev.org"}}{\fldrslt http://sfml-dev.org}} for more information}
\ No newline at end of file diff --git a/examples/cocoa/resources/blue.png b/examples/cocoa/resources/blue.png Binary files differnew file mode 100644 index 0000000..8945e85 --- /dev/null +++ b/examples/cocoa/resources/blue.png diff --git a/examples/cocoa/resources/green.png b/examples/cocoa/resources/green.png Binary files differnew file mode 100644 index 0000000..fac1b69 --- /dev/null +++ b/examples/cocoa/resources/green.png diff --git a/examples/cocoa/resources/icon.icns b/examples/cocoa/resources/icon.icns Binary files differnew file mode 100644 index 0000000..cb95460 --- /dev/null +++ b/examples/cocoa/resources/icon.icns diff --git a/examples/cocoa/resources/logo.png b/examples/cocoa/resources/logo.png Binary files differnew file mode 100644 index 0000000..7b04c41 --- /dev/null +++ b/examples/cocoa/resources/logo.png diff --git a/examples/cocoa/resources/red.png b/examples/cocoa/resources/red.png Binary files differnew file mode 100644 index 0000000..731f36b --- /dev/null +++ b/examples/cocoa/resources/red.png diff --git a/examples/cocoa/resources/sansation.ttf b/examples/cocoa/resources/sansation.ttf Binary files differnew file mode 100644 index 0000000..d85fbc8 --- /dev/null +++ b/examples/cocoa/resources/sansation.ttf diff --git a/examples/opengl/resources/sansation.ttf b/examples/opengl/resources/sansation.ttf Binary files differnew file mode 100644 index 0000000..d85fbc8 --- /dev/null +++ b/examples/opengl/resources/sansation.ttf diff --git a/examples/pong/resources/ball.wav b/examples/pong/resources/ball.wav Binary files differnew file mode 100644 index 0000000..8b3cfba --- /dev/null +++ b/examples/pong/resources/ball.wav diff --git a/examples/pong/resources/sansation.ttf b/examples/pong/resources/sansation.ttf Binary files differnew file mode 100644 index 0000000..d85fbc8 --- /dev/null +++ b/examples/pong/resources/sansation.ttf diff --git a/examples/shader/resources/blink.frag b/examples/shader/resources/blink.frag new file mode 100644 index 0000000..07c8ddb --- /dev/null +++ b/examples/shader/resources/blink.frag @@ -0,0 +1,9 @@ +uniform sampler2D texture; +uniform float blink_alpha; + +void main() +{ + vec4 pixel = gl_Color; + pixel.a = blink_alpha; + gl_FragColor = pixel; +} diff --git a/examples/shader/resources/blur.frag b/examples/shader/resources/blur.frag new file mode 100644 index 0000000..c40e5b3 --- /dev/null +++ b/examples/shader/resources/blur.frag @@ -0,0 +1,20 @@ +uniform sampler2D texture;
+uniform float blur_radius;
+
+void main()
+{
+ vec2 offx = vec2(blur_radius, 0.0);
+ vec2 offy = vec2(0.0, blur_radius);
+
+ vec4 pixel = texture2D(texture, gl_TexCoord[0].xy) * 4.0 +
+ texture2D(texture, gl_TexCoord[0].xy - offx) * 2.0 +
+ texture2D(texture, gl_TexCoord[0].xy + offx) * 2.0 +
+ texture2D(texture, gl_TexCoord[0].xy - offy) * 2.0 +
+ texture2D(texture, gl_TexCoord[0].xy + offy) * 2.0 +
+ texture2D(texture, gl_TexCoord[0].xy - offx - offy) * 1.0 +
+ texture2D(texture, gl_TexCoord[0].xy - offx + offy) * 1.0 +
+ texture2D(texture, gl_TexCoord[0].xy + offx - offy) * 1.0 +
+ texture2D(texture, gl_TexCoord[0].xy + offx + offy) * 1.0;
+
+ gl_FragColor = gl_Color * (pixel / 16.0);
+}
diff --git a/examples/shader/resources/devices.png b/examples/shader/resources/devices.png Binary files differnew file mode 100644 index 0000000..6b1cbc8 --- /dev/null +++ b/examples/shader/resources/devices.png diff --git a/examples/shader/resources/edge.frag b/examples/shader/resources/edge.frag new file mode 100644 index 0000000..14551f9 --- /dev/null +++ b/examples/shader/resources/edge.frag @@ -0,0 +1,32 @@ +uniform sampler2D texture;
+uniform float edge_threshold;
+
+void main()
+{
+ const float offset = 1.0 / 512.0;
+ vec2 offx = vec2(offset, 0.0);
+ vec2 offy = vec2(0.0, offset);
+
+ vec4 hEdge = texture2D(texture, gl_TexCoord[0].xy - offy) * -2.0 +
+ texture2D(texture, gl_TexCoord[0].xy + offy) * 2.0 +
+ texture2D(texture, gl_TexCoord[0].xy - offx - offy) * -1.0 +
+ texture2D(texture, gl_TexCoord[0].xy - offx + offy) * 1.0 +
+ texture2D(texture, gl_TexCoord[0].xy + offx - offy) * -1.0 +
+ texture2D(texture, gl_TexCoord[0].xy + offx + offy) * 1.0;
+
+ vec4 vEdge = texture2D(texture, gl_TexCoord[0].xy - offx) * 2.0 +
+ texture2D(texture, gl_TexCoord[0].xy + offx) * -2.0 +
+ texture2D(texture, gl_TexCoord[0].xy - offx - offy) * 1.0 +
+ texture2D(texture, gl_TexCoord[0].xy - offx + offy) * -1.0 +
+ texture2D(texture, gl_TexCoord[0].xy + offx - offy) * 1.0 +
+ texture2D(texture, gl_TexCoord[0].xy + offx + offy) * -1.0;
+
+ vec3 result = sqrt(hEdge.rgb * hEdge.rgb + vEdge.rgb * vEdge.rgb);
+ float edge = length(result);
+ vec4 pixel = gl_Color * texture2D(texture, gl_TexCoord[0].xy);
+ if (edge > (edge_threshold * 8.0))
+ pixel.rgb = vec3(0.0, 0.0, 0.0);
+ else
+ pixel.a = edge_threshold;
+ gl_FragColor = pixel;
+}
diff --git a/examples/shader/resources/pixelate.frag b/examples/shader/resources/pixelate.frag new file mode 100644 index 0000000..3c8eb0e --- /dev/null +++ b/examples/shader/resources/pixelate.frag @@ -0,0 +1,9 @@ +uniform sampler2D texture;
+uniform float pixel_threshold;
+
+void main()
+{
+ float factor = 1.0 / (pixel_threshold + 0.001);
+ vec2 pos = floor(gl_TexCoord[0].xy * factor + 0.5) / factor;
+ gl_FragColor = texture2D(texture, pos) * gl_Color;
+}
diff --git a/examples/shader/resources/sansation.ttf b/examples/shader/resources/sansation.ttf Binary files differnew file mode 100644 index 0000000..d85fbc8 --- /dev/null +++ b/examples/shader/resources/sansation.ttf diff --git a/examples/shader/resources/sfml.png b/examples/shader/resources/sfml.png Binary files differnew file mode 100644 index 0000000..1da719f --- /dev/null +++ b/examples/shader/resources/sfml.png diff --git a/examples/shader/resources/storm.vert b/examples/shader/resources/storm.vert new file mode 100644 index 0000000..442f80a --- /dev/null +++ b/examples/shader/resources/storm.vert @@ -0,0 +1,19 @@ +uniform vec2 storm_position; +uniform float storm_total_radius; +uniform float storm_inner_radius; + +void main() +{ + vec4 vertex = gl_ModelViewMatrix * gl_Vertex; + vec2 offset = vertex.xy - storm_position; + float len = length(offset); + if (len < storm_total_radius) + { + float push_distance = storm_inner_radius + len / storm_total_radius * (storm_total_radius - storm_inner_radius); + vertex.xy = storm_position + normalize(offset) * push_distance; + } + + gl_Position = gl_ProjectionMatrix * vertex; + gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0; + gl_FrontColor = gl_Color; +} diff --git a/examples/shader/resources/text-background.png b/examples/shader/resources/text-background.png Binary files differnew file mode 100644 index 0000000..c86e9b6 --- /dev/null +++ b/examples/shader/resources/text-background.png diff --git a/examples/shader/resources/wave.vert b/examples/shader/resources/wave.vert new file mode 100644 index 0000000..5089cfb --- /dev/null +++ b/examples/shader/resources/wave.vert @@ -0,0 +1,15 @@ +uniform float wave_phase; +uniform vec2 wave_amplitude; + +void main() +{ + vec4 vertex = gl_Vertex; + vertex.x += cos(gl_Vertex.y * 0.02 + wave_phase * 3.8) * wave_amplitude.x + + sin(gl_Vertex.y * 0.02 + wave_phase * 6.3) * wave_amplitude.x * 0.3; + vertex.y += sin(gl_Vertex.x * 0.02 + wave_phase * 2.4) * wave_amplitude.y + + cos(gl_Vertex.x * 0.02 + wave_phase * 5.2) * wave_amplitude.y * 0.3; + + gl_Position = gl_ModelViewProjectionMatrix * vertex; + gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0; + gl_FrontColor = gl_Color; +} |