summary refs log tree commit diff stats
path: root/ui/shader.c
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2015-01-09 11:40:23 +0100
committerGerd Hoffmann <kraxel@redhat.com>2015-05-05 10:48:22 +0200
commitcd2bc889e5b30c69926fc1511b6522e7cb4c705d (patch)
tree2e436873e72110ad1b22b5b4d84f409d6a05b5aa /ui/shader.c
parent985e1c9b008e5e8b6eac41546266d3abcfa6282a (diff)
downloadfocaccia-qemu-cd2bc889e5b30c69926fc1511b6522e7cb4c705d.tar.gz
focaccia-qemu-cd2bc889e5b30c69926fc1511b6522e7cb4c705d.zip
console-gl: add opengl rendering helper functions
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Diffstat (limited to 'ui/shader.c')
-rw-r--r--ui/shader.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/ui/shader.c b/ui/shader.c
index c3272d690b..52a4632930 100644
--- a/ui/shader.c
+++ b/ui/shader.c
@@ -29,6 +29,25 @@
 
 /* ---------------------------------------------------------------------- */
 
+void qemu_gl_run_texture_blit(GLint texture_blit_prog)
+{
+    GLfloat in_position[] = {
+        -1, -1,
+        1,  -1,
+        -1,  1,
+        1,   1,
+    };
+    GLint l_position;
+
+    glUseProgram(texture_blit_prog);
+    l_position = glGetAttribLocation(texture_blit_prog, "in_position");
+    glVertexAttribPointer(l_position, 2, GL_FLOAT, GL_FALSE, 0, in_position);
+    glEnableVertexAttribArray(l_position);
+    glDrawArrays(GL_TRIANGLE_STRIP, l_position, 4);
+}
+
+/* ---------------------------------------------------------------------- */
+
 GLuint qemu_gl_create_compile_shader(GLenum type, const GLchar *src)
 {
     GLuint shader;