aboutsummaryrefslogtreecommitdiff
path: root/ui/sdl2.c
diff options
context:
space:
mode:
Diffstat (limited to 'ui/sdl2.c')
-rw-r--r--ui/sdl2.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/ui/sdl2.c b/ui/sdl2.c
index b5a0fa1d13..83b917fa37 100644
--- a/ui/sdl2.c
+++ b/ui/sdl2.c
@@ -751,7 +751,7 @@ static const DisplayChangeListenerOps dcl_gl_ops = {
};
#endif
-void sdl_display_early_init(DisplayOptions *o)
+static void sdl2_display_early_init(DisplayOptions *o)
{
assert(o->type == DISPLAY_TYPE_SDL);
if (o->has_gl && o->gl) {
@@ -761,7 +761,7 @@ void sdl_display_early_init(DisplayOptions *o)
}
}
-void sdl_display_init(DisplayState *ds, DisplayOptions *o)
+static void sdl2_display_init(DisplayState *ds, DisplayOptions *o)
{
int flags;
uint8_t data = 0;
@@ -861,3 +861,16 @@ void sdl_display_init(DisplayState *ds, DisplayOptions *o)
atexit(sdl_cleanup);
}
+
+static QemuDisplay qemu_display_sdl2 = {
+ .type = DISPLAY_TYPE_SDL,
+ .early_init = sdl2_display_early_init,
+ .init = sdl2_display_init,
+};
+
+static void register_sdl1(void)
+{
+ qemu_display_register(&qemu_display_sdl2);
+}
+
+type_init(register_sdl1);