aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2016-01-08 12:50:19 +0000
committerPeter Maydell <peter.maydell@linaro.org>2016-01-08 12:50:19 +0000
commit6bb9ead762bf749af11ea225fc2a74db1b93c105 (patch)
tree599fe48ac364f15e925f65dea7c4294133b9cb7c /include
parent9df2513730c5902813f575a74ac9303388fd029d (diff)
parentcb47dc9ab9f55083017291b2b8fbae639c576ec2 (diff)
downloadqemu-6bb9ead762bf749af11ea225fc2a74db1b93c105.zip
qemu-6bb9ead762bf749af11ea225fc2a74db1b93c105.tar.gz
qemu-6bb9ead762bf749af11ea225fc2a74db1b93c105.tar.bz2
Merge remote-tracking branch 'remotes/kraxel/tags/pull-ui-20160108-1' into staging
sdl2/opengl: add opengl context and scanout support ui/curses: Fix color attribute of monitor for curses # gpg: Signature made Fri 08 Jan 2016 12:42:02 GMT using RSA key ID D3E87138 # gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>" # gpg: aka "Gerd Hoffmann <gerd@kraxel.org>" # gpg: aka "Gerd Hoffmann (private) <kraxel@gmail.com>" * remotes/kraxel/tags/pull-ui-20160108-1: sdl2/opengl: add opengl context and scanout support ui/curses: Fix color attribute of monitor for curses Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'include')
-rw-r--r--include/ui/console.h15
-rw-r--r--include/ui/sdl2.h22
2 files changed, 36 insertions, 1 deletions
diff --git a/include/ui/console.h b/include/ui/console.h
index c249db4..adac36d 100644
--- a/include/ui/console.h
+++ b/include/ui/console.h
@@ -30,6 +30,21 @@
#define GUI_REFRESH_INTERVAL_DEFAULT 30
#define GUI_REFRESH_INTERVAL_IDLE 3000
+/* Color number is match to standard vga palette */
+enum qemu_color_names {
+ QEMU_COLOR_BLACK = 0,
+ QEMU_COLOR_BLUE = 1,
+ QEMU_COLOR_GREEN = 2,
+ QEMU_COLOR_CYAN = 3,
+ QEMU_COLOR_RED = 4,
+ QEMU_COLOR_MAGENTA = 5,
+ QEMU_COLOR_YELLOW = 6,
+ QEMU_COLOR_WHITE = 7
+};
+/* Convert to curses char attributes */
+#define ATTR2CHTYPE(c, fg, bg, bold) \
+ ((bold) << 21 | (bg) << 11 | (fg) << 8 | (c))
+
typedef void QEMUPutKBDEvent(void *opaque, int keycode);
typedef void QEMUPutLEDEvent(void *opaque, int ledstate);
typedef void QEMUPutMouseEvent(void *opaque, int dx, int dy, int dz, int buttons_state);
diff --git a/include/ui/sdl2.h b/include/ui/sdl2.h
index 2fdad8f..b7ac38f 100644
--- a/include/ui/sdl2.h
+++ b/include/ui/sdl2.h
@@ -15,12 +15,18 @@ struct sdl2_console {
SDL_Renderer *real_renderer;
int idx;
int last_vm_running; /* per console for caption reasons */
- int x, y;
+ int x, y, w, h;
int hidden;
int opengl;
int updates;
SDL_GLContext winctx;
+#ifdef CONFIG_OPENGL
ConsoleGLState *gls;
+ GLuint tex_id;
+ GLuint fbo_id;
+ bool y0_top;
+ bool scanout_mode;
+#endif
};
void sdl2_window_create(struct sdl2_console *scon);
@@ -48,4 +54,18 @@ void sdl2_gl_switch(DisplayChangeListener *dcl,
void sdl2_gl_refresh(DisplayChangeListener *dcl);
void sdl2_gl_redraw(struct sdl2_console *scon);
+QEMUGLContext sdl2_gl_create_context(DisplayChangeListener *dcl,
+ QEMUGLParams *params);
+void sdl2_gl_destroy_context(DisplayChangeListener *dcl, QEMUGLContext ctx);
+int sdl2_gl_make_context_current(DisplayChangeListener *dcl,
+ QEMUGLContext ctx);
+QEMUGLContext sdl2_gl_get_current_context(DisplayChangeListener *dcl);
+
+void sdl2_gl_scanout(DisplayChangeListener *dcl,
+ uint32_t backing_id, bool backing_y_0_top,
+ uint32_t x, uint32_t y,
+ uint32_t w, uint32_t h);
+void sdl2_gl_scanout_flush(DisplayChangeListener *dcl,
+ uint32_t x, uint32_t y, uint32_t w, uint32_t h);
+
#endif /* SDL2_H */