4 /* Avoid compiler warning because macro is redefined in SDL_syswm.h. */
5 #undef WIN32_LEAN_AND_MEAN
9 /* with Alpine / muslc SDL headers pull in directfb headers
10 * which in turn trigger warning about redundant decls for
11 * direct_waitqueue_deinit.
13 #pragma GCC diagnostic push
14 #pragma GCC diagnostic ignored "-Wredundant-decls"
16 #include <SDL_syswm.h>
18 #pragma GCC diagnostic pop
20 #ifdef CONFIG_SDL_IMAGE
21 # include <SDL_image.h>
24 #include "ui/kbd-state.h"
26 # include "ui/egl-helpers.h"
31 DisplayChangeListener dcl
;
32 DisplaySurface
*surface
;
35 SDL_Window
*real_window
;
36 SDL_Renderer
*real_renderer
;
38 int last_vm_running
; /* per console for caption reasons */
56 void sdl2_window_create(struct sdl2_console
*scon
);
57 void sdl2_window_destroy(struct sdl2_console
*scon
);
58 void sdl2_window_resize(struct sdl2_console
*scon
);
59 void sdl2_poll_events(struct sdl2_console
*scon
);
61 void sdl2_process_key(struct sdl2_console
*scon
,
62 SDL_KeyboardEvent
*ev
);
64 void sdl2_2d_update(DisplayChangeListener
*dcl
,
65 int x
, int y
, int w
, int h
);
66 void sdl2_2d_switch(DisplayChangeListener
*dcl
,
67 DisplaySurface
*new_surface
);
68 void sdl2_2d_refresh(DisplayChangeListener
*dcl
);
69 void sdl2_2d_redraw(struct sdl2_console
*scon
);
70 bool sdl2_2d_check_format(DisplayChangeListener
*dcl
,
71 pixman_format_code_t format
);
73 void sdl2_gl_update(DisplayChangeListener
*dcl
,
74 int x
, int y
, int w
, int h
);
75 void sdl2_gl_switch(DisplayChangeListener
*dcl
,
76 DisplaySurface
*new_surface
);
77 void sdl2_gl_refresh(DisplayChangeListener
*dcl
);
78 void sdl2_gl_redraw(struct sdl2_console
*scon
);
80 QEMUGLContext
sdl2_gl_create_context(DisplayGLCtx
*dgc
,
81 QEMUGLParams
*params
);
82 void sdl2_gl_destroy_context(DisplayGLCtx
*dgc
, QEMUGLContext ctx
);
83 int sdl2_gl_make_context_current(DisplayGLCtx
*dgc
,
86 void sdl2_gl_scanout_disable(DisplayChangeListener
*dcl
);
87 void sdl2_gl_scanout_texture(DisplayChangeListener
*dcl
,
90 uint32_t backing_width
,
91 uint32_t backing_height
,
92 uint32_t x
, uint32_t y
,
93 uint32_t w
, uint32_t h
,
95 void sdl2_gl_scanout_flush(DisplayChangeListener
*dcl
,
96 uint32_t x
, uint32_t y
, uint32_t w
, uint32_t h
);