diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2015-01-09 11:40:23 +0100 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2015-05-05 10:48:22 +0200 |
commit | cd2bc889e5b30c69926fc1511b6522e7cb4c705d (patch) | |
tree | 2e436873e72110ad1b22b5b4d84f409d6a05b5aa /ui/shader | |
parent | 985e1c9b008e5e8b6eac41546266d3abcfa6282a (diff) | |
download | qemu-cd2bc889e5b30c69926fc1511b6522e7cb4c705d.zip qemu-cd2bc889e5b30c69926fc1511b6522e7cb4c705d.tar.gz qemu-cd2bc889e5b30c69926fc1511b6522e7cb4c705d.tar.bz2 |
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')
-rw-r--r-- | ui/shader/texture-blit.frag | 10 | ||||
-rw-r--r-- | ui/shader/texture-blit.vert | 10 |
2 files changed, 20 insertions, 0 deletions
diff --git a/ui/shader/texture-blit.frag b/ui/shader/texture-blit.frag new file mode 100644 index 0000000..bfa202c --- /dev/null +++ b/ui/shader/texture-blit.frag @@ -0,0 +1,10 @@ + +#version 300 es + +uniform sampler2D image; +in mediump vec2 ex_tex_coord; +out mediump vec4 out_frag_color; + +void main(void) { + out_frag_color = texture(image, ex_tex_coord); +} diff --git a/ui/shader/texture-blit.vert b/ui/shader/texture-blit.vert new file mode 100644 index 0000000..6fe2744 --- /dev/null +++ b/ui/shader/texture-blit.vert @@ -0,0 +1,10 @@ + +#version 300 es + +in vec2 in_position; +out vec2 ex_tex_coord; + +void main(void) { + gl_Position = vec4(in_position, 0.0, 1.0); + ex_tex_coord = vec2(1.0 + in_position.x, 1.0 - in_position.y) * 0.5; +} |