spapr: Clean up local variable shadowing in spapr_dt_cpus()
[qemu/kevin.git] / include / ui / sdl2.h
blobe3acc7c82a7052ed93ed5d9f3241552ce68eeaa7
1 #ifndef SDL2_H
2 #define SDL2_H
4 /* Avoid compiler warning because macro is redefined in SDL_syswm.h. */
5 #undef WIN32_LEAN_AND_MEAN
7 #include <SDL.h>
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>
22 #endif
24 #include "ui/kbd-state.h"
25 #ifdef CONFIG_OPENGL
26 # include "ui/egl-helpers.h"
27 #endif
29 struct sdl2_console {
30 DisplayGLCtx dgc;
31 DisplayChangeListener dcl;
32 DisplaySurface *surface;
33 DisplayOptions *opts;
34 SDL_Texture *texture;
35 SDL_Window *real_window;
36 SDL_Renderer *real_renderer;
37 int idx;
38 int last_vm_running; /* per console for caption reasons */
39 int x, y, w, h;
40 int hidden;
41 int opengl;
42 int updates;
43 int idle_counter;
44 int ignore_hotkeys;
45 SDL_GLContext winctx;
46 QKbdState *kbd;
47 #ifdef CONFIG_OPENGL
48 QemuGLShader *gls;
49 egl_fb guest_fb;
50 egl_fb win_fb;
51 bool y0_top;
52 bool scanout_mode;
53 #endif
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,
84 QEMUGLContext ctx);
86 void sdl2_gl_scanout_disable(DisplayChangeListener *dcl);
87 void sdl2_gl_scanout_texture(DisplayChangeListener *dcl,
88 uint32_t backing_id,
89 bool backing_y_0_top,
90 uint32_t backing_width,
91 uint32_t backing_height,
92 uint32_t x, uint32_t y,
93 uint32_t w, uint32_t h,
94 void *d3d_tex2d);
95 void sdl2_gl_scanout_flush(DisplayChangeListener *dcl,
96 uint32_t x, uint32_t y, uint32_t w, uint32_t h);
98 #endif /* SDL2_H */