mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 07:43:54 -06:00
ui: split the GL context in a different object
This will allow to have one GL context but a variable number of listeners. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Acked-by: Gerd Hoffmann <kraxel@redhat.com>
This commit is contained in:
parent
7cc712e986
commit
5e79d516e8
14 changed files with 119 additions and 76 deletions
10
ui/sdl2-gl.c
10
ui/sdl2-gl.c
|
@ -132,10 +132,10 @@ void sdl2_gl_redraw(struct sdl2_console *scon)
|
|||
}
|
||||
}
|
||||
|
||||
QEMUGLContext sdl2_gl_create_context(DisplayChangeListener *dcl,
|
||||
QEMUGLContext sdl2_gl_create_context(DisplayGLCtx *dgc,
|
||||
QEMUGLParams *params)
|
||||
{
|
||||
struct sdl2_console *scon = container_of(dcl, struct sdl2_console, dcl);
|
||||
struct sdl2_console *scon = container_of(dgc, struct sdl2_console, dgc);
|
||||
SDL_GLContext ctx;
|
||||
|
||||
assert(scon->opengl);
|
||||
|
@ -167,17 +167,17 @@ QEMUGLContext sdl2_gl_create_context(DisplayChangeListener *dcl,
|
|||
return (QEMUGLContext)ctx;
|
||||
}
|
||||
|
||||
void sdl2_gl_destroy_context(DisplayChangeListener *dcl, QEMUGLContext ctx)
|
||||
void sdl2_gl_destroy_context(DisplayGLCtx *dgc, QEMUGLContext ctx)
|
||||
{
|
||||
SDL_GLContext sdlctx = (SDL_GLContext)ctx;
|
||||
|
||||
SDL_GL_DeleteContext(sdlctx);
|
||||
}
|
||||
|
||||
int sdl2_gl_make_context_current(DisplayChangeListener *dcl,
|
||||
int sdl2_gl_make_context_current(DisplayGLCtx *dgc,
|
||||
QEMUGLContext ctx)
|
||||
{
|
||||
struct sdl2_console *scon = container_of(dcl, struct sdl2_console, dcl);
|
||||
struct sdl2_console *scon = container_of(dgc, struct sdl2_console, dgc);
|
||||
SDL_GLContext sdlctx = (SDL_GLContext)ctx;
|
||||
|
||||
assert(scon->opengl);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue