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 /include/ui | |
parent | 985e1c9b008e5e8b6eac41546266d3abcfa6282a (diff) |
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 'include/ui')
-rw-r--r-- | include/ui/console.h | 31 | ||||
-rw-r--r-- | include/ui/shader.h | 2 |
2 files changed, 33 insertions, 0 deletions
diff --git a/include/ui/console.h b/include/ui/console.h index 03cd665a8f..ee00fc58f2 100644 --- a/include/ui/console.h +++ b/include/ui/console.h @@ -9,6 +9,11 @@ #include "qapi-types.h" #include "qapi/error.h" +#ifdef CONFIG_OPENGL +# include <GLES2/gl2.h> +# include <GLES2/gl2ext.h> +#endif + /* keyboard/mouse support */ #define MOUSE_EVENT_LBUTTON 0x01 @@ -117,6 +122,11 @@ struct DisplaySurface { pixman_format_code_t format; pixman_image_t *image; uint8_t flags; +#ifdef CONFIG_OPENGL + GLenum glformat; + GLenum gltype; + GLuint texture; +#endif }; typedef struct QemuUIInfo { @@ -322,6 +332,27 @@ void qemu_console_copy(QemuConsole *con, int src_x, int src_y, int dst_x, int dst_y, int w, int h); DisplaySurface *qemu_console_surface(QemuConsole *con); +/* console-gl.c */ +typedef struct ConsoleGLState ConsoleGLState; +#ifdef CONFIG_OPENGL +ConsoleGLState *console_gl_init_context(void); +void console_gl_fini_context(ConsoleGLState *gls); +bool console_gl_check_format(DisplayChangeListener *dcl, + pixman_format_code_t format); +void surface_gl_create_texture(ConsoleGLState *gls, + DisplaySurface *surface); +void surface_gl_update_texture(ConsoleGLState *gls, + DisplaySurface *surface, + int x, int y, int w, int h); +void surface_gl_render_texture(ConsoleGLState *gls, + DisplaySurface *surface); +void surface_gl_destroy_texture(ConsoleGLState *gls, + DisplaySurface *surface); +void surface_gl_setup_viewport(ConsoleGLState *gls, + DisplaySurface *surface, + int ww, int wh); +#endif + /* sdl.c */ void sdl_display_init(DisplayState *ds, int full_screen, int no_frame); diff --git a/include/ui/shader.h b/include/ui/shader.h index e1b0caf796..1ff926c9e1 100644 --- a/include/ui/shader.h +++ b/include/ui/shader.h @@ -3,6 +3,8 @@ # include <GLES2/gl2ext.h> #endif +void qemu_gl_run_texture_blit(GLint texture_blit_prog); + GLuint qemu_gl_create_compile_shader(GLenum type, const GLchar *src); GLuint qemu_gl_create_link_program(GLuint vert, GLuint frag); GLuint qemu_gl_create_compile_link_program(const GLchar *vert_src, |