From 5ee1718f92bd82e0e581191b6326384d291199d3 Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Thu, 1 Mar 2018 11:05:36 +0100 Subject: sdl: switch over to new display registry Signed-off-by: Gerd Hoffmann Message-id: 20180301100547.18962-3-kraxel@redhat.com --- ui/sdl.c | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) (limited to 'ui/sdl.c') diff --git a/ui/sdl.c b/ui/sdl.c index c4ae7ab05d..a5fd503c25 100644 --- a/ui/sdl.c +++ b/ui/sdl.c @@ -901,17 +901,7 @@ static const DisplayChangeListenerOps dcl_ops = { .dpy_cursor_define = sdl_mouse_define, }; -void sdl_display_early_init(DisplayOptions *opts) -{ - if (opts->has_gl && opts->gl) { - fprintf(stderr, - "SDL1 display code has no opengl support.\n" - "Please recompile qemu with SDL2, using\n" - "./configure --enable-sdl --with-sdlabi=2.0\n"); - } -} - -void sdl_display_init(DisplayState *ds, DisplayOptions *o) +static void sdl1_display_init(DisplayState *ds, DisplayOptions *o) { int flags; uint8_t data = 0; @@ -1023,3 +1013,15 @@ void sdl_display_init(DisplayState *ds, DisplayOptions *o) atexit(sdl_cleanup); } + +static QemuDisplay qemu_display_sdl1 = { + .type = DISPLAY_TYPE_SDL, + .init = sdl1_display_init, +}; + +static void register_sdl1(void) +{ + qemu_display_register(&qemu_display_sdl1); +} + +type_init(register_sdl1); -- cgit 1.4.1