mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-09 18:44:58 -06:00
sdl: switch over to new display registry
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Message-id: 20180301100547.18962-3-kraxel@redhat.com
This commit is contained in:
parent
db71589fd9
commit
5ee1718f92
4 changed files with 29 additions and 46 deletions
24
ui/sdl.c
24
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);
|
||||
|
|
17
ui/sdl2.c
17
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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue