1 #ifndef SDLOUTPUTSURFACE_HH
2 #define SDLOUTPUTSURFACE_HH
17 template<std::
unsigned_
integral Pixel>
19 return reinterpret_cast<Pixel*
>(
static_cast<char*
>(surface->pixels) + y * surface->pitch);
73 SDL_Surface* surface =
nullptr;
74 SDL_Renderer* renderer =
nullptr;
A frame buffer where pixels can be written to.
Pixel * getLinePtr(unsigned y)
SDLDirectPixelAccess(SDL_Surface *surface_)
A frame buffer where pixels can be written to.
void setSDLSurface(SDL_Surface *surface_)
SDLOutputSurface()=default
virtual void flushFrameBuffer()
Copy frame buffer to display buffer.
virtual void clearScreen()
Clear frame buffer (paint it black).
SDLDirectPixelAccess getDirectPixelAccess()
Return a SDLDirectPixelAccess object.
SDL_Surface * getSDLSurface() const
SDLOutputSurface & operator=(const SDLOutputSurface &)=delete
void setSDLPixelFormat(const SDL_PixelFormat &format)
SDL_Renderer * getSDLRenderer() const
SDLOutputSurface(const SDLOutputSurface &)=delete
void setSDLRenderer(SDL_Renderer *r)
This file implemented 3 utility functions: