summaryrefslogtreecommitdiff
path: root/src/static_blend.vert
diff options
context:
space:
mode:
authorDavid Herrmann <dh.herrmann@googlemail.com>2012-08-08 19:01:53 +0200
committerDavid Herrmann <dh.herrmann@googlemail.com>2012-08-08 19:11:42 +0200
commite1bf9c5c196bff9f134a553dbc6f7a92864109ff (patch)
tree1bdc9869ff09234ab64e53ea18c4f168618a2929 /src/static_blend.vert
parentc677377e0447efdd0aeb5128ded7c614651951a1 (diff)
uterm: video: drm: implement .blit, .blend and .fill callbacks
This implements the static 2D blitting callbacks for the DRM backend. It uses OpenGL to push the images with textures through the rendering pipeline. Please note that this is horribly slow when used like 2D blitting. However, it is a safe backend and better than nothing. Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Diffstat (limited to 'src/static_blend.vert')
-rw-r--r--src/static_blend.vert42
1 files changed, 42 insertions, 0 deletions
diff --git a/src/static_blend.vert b/src/static_blend.vert
new file mode 100644
index 0000000..82b598d
--- /dev/null
+++ b/src/static_blend.vert
@@ -0,0 +1,42 @@
+/*
+ * kmscon - Vertex Shader
+ *
+ * Copyright (c) 2011-2012 David Herrmann <dh.herrmann@googlemail.com>
+ * Copyright (c) 2011 University of Tuebingen
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files
+ * (the "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/*
+ * Vertex Shader
+ * This shader is a very basic vertex shader which forwards all data and
+ * performs basic matrix multiplications.
+ */
+
+uniform mat4 projection;
+attribute vec2 position;
+attribute vec2 texture_position;
+varying vec2 texpos;
+
+void main()
+{
+ gl_Position = projection * vec4(position, 0.0, 1.0);
+ texpos = texture_position;
+}