24 assert((pitch2 % 16) == 0);
25 unsigned bufSize = pitch2 * proto.h;
28 surface.
reset(SDL_CreateRGBSurfaceFrom(
29 buffer.
data(), proto.w, proto.h, narrow<int>(frmt.
getBpp()), narrow<int>(pitch2),
35 renderer.reset(SDL_CreateSoftwareRenderer(surface.
get()));
39void SDLOffScreenSurface::saveScreenshot(
const std::string& filename)
44void SDLOffScreenSurface::clearScreen()
46 memset(surface->pixels, 0,
size_t(surface->pitch) * surface->h);
void reset(SDL_Surface *surface_=nullptr)
void resize(size_t size)
Grow or shrink the memory block.
const T * data() const
Returns pointer to the start of the memory buffer.
const PixelFormat & getPixelFormat() const
void calculateViewPort(gl::ivec2 logSize, gl::ivec2 physSize)
SDLOffScreenSurface(const SDL_Surface &prototype)
void setSDLSurface(SDL_Surface *surface_)
void setSDLPixelFormat(const SDL_PixelFormat &format)
void setSDLRenderer(SDL_Renderer *r)
static void saveScreenshotSDL(const SDLOutputSurface &output, const std::string &filename)
This file implemented 3 utility functions:
constexpr void fill(ForwardRange &&range, const T &value)
size_t size(std::string_view utf8)