1 #ifndef LIBWTK_SDL2_UTIL 2 #define LIBWTK_SDL2_UTIL 5 #include <SDL2/SDL_rect.h> 6 #include <SDL2/SDL_surface.h> 8 #include "geometry.hpp" 12 void operator()(SDL_Surface * s);
15 typedef std::unique_ptr<SDL_Surface, surface_deleter> unique_surface_ptr;
19 void operator()(SDL_Texture * t);
22 typedef std::unique_ptr<SDL_Texture, texture_destroyer> unique_texture_ptr;
24 unique_texture_ptr load_texture_from_image(SDL_Renderer * r, std::string filename);
26 SDL_Renderer * renderer_from_window(SDL_Window * window);
27 SDL_Rect box_from_renderer(SDL_Renderer * renderer);
29 void print_rect(SDL_Rect
const & r);
34 SDL_Surface * create_surface(uint32_t pfe,
int width,
int height);
35 SDL_Surface * create_surface(SDL_PixelFormat
const * pf,
int width,
int height);
39 std::tuple<SDL_Rect, SDL_Rect, SDL_Rect> scale_preserve_ar(
vec size, SDL_Rect target);
42 void blit_preserve_ar(SDL_Surface * source, SDL_Surface * dest, SDL_Rect
const * destrect);
44 vec texture_dim(SDL_Texture * tex);
Definition: sdl_util.hpp:17
Definition: padding.hpp:6
Definition: geometry.hpp:12
Definition: sdl_util.hpp:10