aboutsummaryrefslogtreecommitdiff
path: root/ui
diff options
context:
space:
mode:
Diffstat (limited to 'ui')
-rw-r--r--ui/console.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/ui/console.c b/ui/console.c
index dcc21eb5b2..7b83e6cdea 100644
--- a/ui/console.c
+++ b/ui/console.c
@@ -1443,6 +1443,19 @@ static bool dpy_compatible_with(QemuConsole *con,
return true;
}
+void qemu_console_set_display_gl_ctx(QemuConsole *con,
+ DisplayChangeListener *dcl)
+{
+ /* display has opengl support */
+ assert(dcl->con);
+ if (dcl->con->gl) {
+ fprintf(stderr, "can't register two opengl displays (%s, %s)\n",
+ dcl->ops->dpy_name, dcl->con->gl->ops->dpy_name);
+ exit(1);
+ }
+ dcl->con->gl = dcl;
+}
+
void register_displaychangelistener(DisplayChangeListener *dcl)
{
static const char nodev[] =
@@ -1453,14 +1466,7 @@ void register_displaychangelistener(DisplayChangeListener *dcl)
assert(!dcl->ds);
if (dcl->ops->dpy_gl_ctx_create) {
- /* display has opengl support */
- assert(dcl->con);
- if (dcl->con->gl) {
- fprintf(stderr, "can't register two opengl displays (%s, %s)\n",
- dcl->ops->dpy_name, dcl->con->gl->ops->dpy_name);
- exit(1);
- }
- dcl->con->gl = dcl;
+ qemu_console_set_display_gl_ctx(dcl->con, dcl);
}
if (dcl->con) {