mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 15:23:53 -06:00
sdl2: add support for display rendering using opengl.
Add new sdl2-gl.c file, with display rendering functions using opengl. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com>
This commit is contained in:
parent
19dadfccd0
commit
0b71a5d5ca
8 changed files with 225 additions and 7 deletions
|
@ -36,6 +36,8 @@ void sdl2_2d_update(DisplayChangeListener *dcl,
|
|||
DisplaySurface *surf = qemu_console_surface(dcl->con);
|
||||
SDL_Rect rect;
|
||||
|
||||
assert(!scon->opengl);
|
||||
|
||||
if (!surf) {
|
||||
return;
|
||||
}
|
||||
|
@ -61,6 +63,8 @@ void sdl2_2d_switch(DisplayChangeListener *dcl,
|
|||
DisplaySurface *old_surface = scon->surface;
|
||||
int format = 0;
|
||||
|
||||
assert(!scon->opengl);
|
||||
|
||||
scon->surface = new_surface;
|
||||
|
||||
if (scon->texture) {
|
||||
|
@ -101,12 +105,15 @@ void sdl2_2d_refresh(DisplayChangeListener *dcl)
|
|||
{
|
||||
struct sdl2_console *scon = container_of(dcl, struct sdl2_console, dcl);
|
||||
|
||||
assert(!scon->opengl);
|
||||
graphic_hw_update(dcl->con);
|
||||
sdl2_poll_events(scon);
|
||||
}
|
||||
|
||||
void sdl2_2d_redraw(struct sdl2_console *scon)
|
||||
{
|
||||
assert(!scon->opengl);
|
||||
|
||||
if (!scon->surface) {
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue