From 14833f2e5bddab2ff0ac637fe1340ade94eb88ae Mon Sep 17 00:00:00 2001 From: Vegard Storheil Eriksen Date: Fri, 21 May 2010 00:59:44 +0200 Subject: Moved resource files. --- VeraMono.ttf | Bin 49224 -> 0 bytes application.cpp | 10 +++++----- background.png | Bin 13359 -> 0 bytes bullet_fragment.glsl | 15 --------------- bullet_vertex.glsl | 14 -------------- fonts/VeraMono.ttf | Bin 0 -> 49224 bytes foo.png | Bin 1435 -> 0 bytes foo2.png | Bin 1024 -> 0 bytes foo4.png | Bin 5967 -> 0 bytes shaders/bullet_fragment.glsl | 15 +++++++++++++++ shaders/bullet_vertex.glsl | 14 ++++++++++++++ textures/background.png | Bin 0 -> 13359 bytes textures/shot1.png | Bin 0 -> 5967 bytes 13 files changed, 34 insertions(+), 34 deletions(-) delete mode 100644 VeraMono.ttf delete mode 100644 background.png delete mode 100644 bullet_fragment.glsl delete mode 100644 bullet_vertex.glsl create mode 100644 fonts/VeraMono.ttf delete mode 100644 foo.png delete mode 100644 foo2.png delete mode 100644 foo4.png create mode 100644 shaders/bullet_fragment.glsl create mode 100644 shaders/bullet_vertex.glsl create mode 100644 textures/background.png create mode 100644 textures/shot1.png diff --git a/VeraMono.ttf b/VeraMono.ttf deleted file mode 100644 index 139f0b4..0000000 Binary files a/VeraMono.ttf and /dev/null differ diff --git a/application.cpp b/application.cpp index 87797b1..f7ddaae 100644 --- a/application.cpp +++ b/application.cpp @@ -141,10 +141,10 @@ void Application::run() { elapsed = 0; paused = false; - font = new FTPixmapFont("VeraMono.ttf"); + font = new FTPixmapFont("fonts/VeraMono.ttf"); font->FaceSize(12); - background = new TextureSDL("background.png"); - texture = new TextureSDL("foo4.png"); + background = new TextureSDL("textures/background.png"); + texture = new TextureSDL("textures/shot1.png"); shader = new GLShaderProgram(); patterns.push_back(new BulletPattern()); @@ -153,8 +153,8 @@ void Application::run() { } patterns.push_back(new BulletPattern2(9000)); - GLFragmentShader shader1("bullet_fragment.glsl"); - GLVertexShader shader2("bullet_vertex.glsl"); + GLFragmentShader shader1("shaders/bullet_fragment.glsl"); + GLVertexShader shader2("shaders/bullet_vertex.glsl"); shader->attach(shader1); shader->attach(shader2); shader->link(); diff --git a/background.png b/background.png deleted file mode 100644 index a97cc05..0000000 Binary files a/background.png and /dev/null differ diff --git a/bullet_fragment.glsl b/bullet_fragment.glsl deleted file mode 100644 index 5e8becd..0000000 --- a/bullet_fragment.glsl +++ /dev/null @@ -1,15 +0,0 @@ -varying mat4 v_tex_rot; -uniform sampler2D tex; - -void main() { - vec2 l_uv = gl_TexCoord[0].xy; - const vec2 l_offset = vec2(0.5, 0.5); - l_uv -= l_offset; - l_uv = vec2(v_tex_rot * vec4(l_uv, 0.0, 1.0)); - l_uv += l_offset; - gl_FragColor = texture2D(tex, l_uv); - float M = max(max(gl_FragColor.x, gl_FragColor.y), gl_FragColor.z); - float C = M - min(min(gl_FragColor.x, gl_FragColor.y), gl_FragColor.z); - float S = C > 0.0 ? C / M : 0.0; - gl_FragColor.xyz = M * mix(vec3(1.0, 1.0, 1.0), gl_Color.xyz, S); -} diff --git a/bullet_vertex.glsl b/bullet_vertex.glsl deleted file mode 100644 index 0843be2..0000000 --- a/bullet_vertex.glsl +++ /dev/null @@ -1,14 +0,0 @@ -varying mat4 v_tex_rot; - -void main() { - vec4 l_position = gl_Vertex; - vec2 l_direction = normalize(vec2(l_position.z, l_position.w)); - v_tex_rot = mat4(l_direction.x, l_direction.y, 0.0, 0.0, - -l_direction.y, l_direction.x, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - 0.0, 0.0, 0.0, 1.0); - l_position.z = 0.0; - l_position.w = 1.0; - gl_FrontColor = gl_Color; - gl_Position = gl_ModelViewProjectionMatrix * l_position; -} diff --git a/fonts/VeraMono.ttf b/fonts/VeraMono.ttf new file mode 100644 index 0000000..139f0b4 Binary files /dev/null and b/fonts/VeraMono.ttf differ diff --git a/foo.png b/foo.png deleted file mode 100644 index c87d1f1..0000000 Binary files a/foo.png and /dev/null differ diff --git a/foo2.png b/foo2.png deleted file mode 100644 index 7673659..0000000 Binary files a/foo2.png and /dev/null differ diff --git a/foo4.png b/foo4.png deleted file mode 100644 index 7c9b56f..0000000 Binary files a/foo4.png and /dev/null differ diff --git a/shaders/bullet_fragment.glsl b/shaders/bullet_fragment.glsl new file mode 100644 index 0000000..5e8becd --- /dev/null +++ b/shaders/bullet_fragment.glsl @@ -0,0 +1,15 @@ +varying mat4 v_tex_rot; +uniform sampler2D tex; + +void main() { + vec2 l_uv = gl_TexCoord[0].xy; + const vec2 l_offset = vec2(0.5, 0.5); + l_uv -= l_offset; + l_uv = vec2(v_tex_rot * vec4(l_uv, 0.0, 1.0)); + l_uv += l_offset; + gl_FragColor = texture2D(tex, l_uv); + float M = max(max(gl_FragColor.x, gl_FragColor.y), gl_FragColor.z); + float C = M - min(min(gl_FragColor.x, gl_FragColor.y), gl_FragColor.z); + float S = C > 0.0 ? C / M : 0.0; + gl_FragColor.xyz = M * mix(vec3(1.0, 1.0, 1.0), gl_Color.xyz, S); +} diff --git a/shaders/bullet_vertex.glsl b/shaders/bullet_vertex.glsl new file mode 100644 index 0000000..0843be2 --- /dev/null +++ b/shaders/bullet_vertex.glsl @@ -0,0 +1,14 @@ +varying mat4 v_tex_rot; + +void main() { + vec4 l_position = gl_Vertex; + vec2 l_direction = normalize(vec2(l_position.z, l_position.w)); + v_tex_rot = mat4(l_direction.x, l_direction.y, 0.0, 0.0, + -l_direction.y, l_direction.x, 0.0, 0.0, + 0.0, 0.0, 1.0, 0.0, + 0.0, 0.0, 0.0, 1.0); + l_position.z = 0.0; + l_position.w = 1.0; + gl_FrontColor = gl_Color; + gl_Position = gl_ModelViewProjectionMatrix * l_position; +} diff --git a/textures/background.png b/textures/background.png new file mode 100644 index 0000000..a97cc05 Binary files /dev/null and b/textures/background.png differ diff --git a/textures/shot1.png b/textures/shot1.png new file mode 100644 index 0000000..7c9b56f Binary files /dev/null and b/textures/shot1.png differ -- cgit v1.2.3