Loading include/ui/sdl2.h +2 −0 Original line number Diff line number Diff line Loading @@ -28,5 +28,7 @@ void sdl2_2d_switch(DisplayChangeListener *dcl, DisplaySurface *new_surface); void sdl2_2d_refresh(DisplayChangeListener *dcl); void sdl2_2d_redraw(struct sdl2_console *scon); bool sdl2_2d_check_format(DisplayChangeListener *dcl, pixman_format_code_t format); #endif /* SDL2_H */ ui/sdl2-2d.c +13 −0 Original line number Diff line number Diff line Loading @@ -120,3 +120,16 @@ void sdl2_2d_redraw(struct sdl2_console *scon) surface_width(scon->surface), surface_height(scon->surface)); } bool sdl2_2d_check_format(DisplayChangeListener *dcl, pixman_format_code_t format) { /* * We let SDL convert for us a few more formats than, * the native ones. Thes are the ones I have tested. */ return (format == PIXMAN_x8r8g8b8 || format == PIXMAN_b8g8r8x8 || format == PIXMAN_x1r5g5b5 || format == PIXMAN_r5g6b5); } ui/sdl2.c +7 −6 Original line number Diff line number Diff line Loading @@ -671,6 +671,7 @@ static const DisplayChangeListenerOps dcl_2d_ops = { .dpy_name = "sdl2-2d", .dpy_gfx_update = sdl2_2d_update, .dpy_gfx_switch = sdl2_2d_switch, .dpy_gfx_check_format = sdl2_2d_check_format, .dpy_refresh = sdl2_2d_refresh, .dpy_mouse_set = sdl_mouse_warp, .dpy_cursor_define = sdl_mouse_define, Loading Loading
include/ui/sdl2.h +2 −0 Original line number Diff line number Diff line Loading @@ -28,5 +28,7 @@ void sdl2_2d_switch(DisplayChangeListener *dcl, DisplaySurface *new_surface); void sdl2_2d_refresh(DisplayChangeListener *dcl); void sdl2_2d_redraw(struct sdl2_console *scon); bool sdl2_2d_check_format(DisplayChangeListener *dcl, pixman_format_code_t format); #endif /* SDL2_H */
ui/sdl2-2d.c +13 −0 Original line number Diff line number Diff line Loading @@ -120,3 +120,16 @@ void sdl2_2d_redraw(struct sdl2_console *scon) surface_width(scon->surface), surface_height(scon->surface)); } bool sdl2_2d_check_format(DisplayChangeListener *dcl, pixman_format_code_t format) { /* * We let SDL convert for us a few more formats than, * the native ones. Thes are the ones I have tested. */ return (format == PIXMAN_x8r8g8b8 || format == PIXMAN_b8g8r8x8 || format == PIXMAN_x1r5g5b5 || format == PIXMAN_r5g6b5); }
ui/sdl2.c +7 −6 Original line number Diff line number Diff line Loading @@ -671,6 +671,7 @@ static const DisplayChangeListenerOps dcl_2d_ops = { .dpy_name = "sdl2-2d", .dpy_gfx_update = sdl2_2d_update, .dpy_gfx_switch = sdl2_2d_switch, .dpy_gfx_check_format = sdl2_2d_check_format, .dpy_refresh = sdl2_2d_refresh, .dpy_mouse_set = sdl_mouse_warp, .dpy_cursor_define = sdl_mouse_define, Loading