openMSX
|
A frame buffer where pixels can be written to. More...
#include <SDLOutputSurface.hh>
Public Member Functions | |
SDLOutputSurface (const SDLOutputSurface &)=delete | |
SDLOutputSurface & | operator= (const SDLOutputSurface &)=delete |
SDL_Surface * | getSDLSurface () const |
SDL_Renderer * | getSDLRenderer () const |
SDLDirectPixelAccess | getDirectPixelAccess () |
Return a SDLDirectPixelAccess object. More... | |
virtual void | flushFrameBuffer () |
Copy frame buffer to display buffer. More... | |
virtual void | clearScreen () |
Clear frame buffer (paint it black). More... | |
![]() | |
OutputSurface (const OutputSurface &)=delete | |
OutputSurface & | operator= (const OutputSurface &)=delete |
virtual | ~OutputSurface ()=default |
int | getLogicalWidth () const |
int | getLogicalHeight () const |
gl::ivec2 | getLogicalSize () const |
gl::ivec2 | getPhysicalSize () const |
gl::ivec2 | getViewOffset () const |
gl::ivec2 | getViewSize () const |
gl::vec2 | getViewScale () const |
bool | isViewScaled () const |
const PixelFormat & | getPixelFormat () const |
uint32_t | mapRGB (gl::vec3 rgb) const |
Returns the pixel value for the given RGB color. More... | |
uint32_t | mapRGB255 (gl::ivec3 rgb) const |
Same as mapRGB, but RGB components are in range [0..255]. More... | |
template<typename Pixel > | |
Pixel | getKeyColor () const |
Returns the color key for this output surface. More... | |
template<typename Pixel > | |
Pixel | getKeyColorClash () const |
Returns a color that is visually very close to the key color. More... | |
template<typename Pixel > | |
Pixel | mapKeyedRGB255 (gl::ivec3 rgb) |
Returns the pixel value for the given RGB color. More... | |
template<typename Pixel > | |
Pixel | mapKeyedRGB (gl::vec3 rgb) |
Returns the pixel value for the given RGB color. More... | |
virtual void | saveScreenshot (const std::string &filename)=0 |
Save the content of this OutputSurface to a PNG file. More... | |
Protected Member Functions | |
SDLOutputSurface ()=default | |
void | setSDLPixelFormat (const SDL_PixelFormat &format) |
void | setSDLSurface (SDL_Surface *surface_) |
void | setSDLRenderer (SDL_Renderer *r) |
![]() | |
OutputSurface ()=default | |
void | calculateViewPort (gl::ivec2 logSize, gl::ivec2 physSize) |
void | setPixelFormat (const PixelFormat &format) |
void | setOpenGlPixelFormat () |
A frame buffer where pixels can be written to.
It could be an in-memory buffer or a video buffer visible to the user (see VisibleSurface subclass).
Definition at line 29 of file SDLOutputSurface.hh.
|
delete |
|
protecteddefault |
|
inlinevirtual |
Clear frame buffer (paint it black).
The default implementation does nothing.
Reimplemented in openmsx::SDLVisibleSurface.
Definition at line 62 of file SDLOutputSurface.hh.
|
inlinevirtual |
Copy frame buffer to display buffer.
The default implementation does nothing.
Reimplemented in openmsx::SDLVisibleSurface.
Definition at line 57 of file SDLOutputSurface.hh.
|
inline |
Return a SDLDirectPixelAccess object.
Via this object pointers to individual Pixel lines can be obtained. Those pointer only remain valid for as long as the SDLDirectPixelAccess object is kept alive. And that object should be kept for at most the duration of one frame. (This allows the implementation to lock/unlock the underlying SDL surface).
Note that direct pixel access is not always supported (e.g. not for openGL based surfaces). TODO can we move this method down the class hierarchy so that it's only available on classes that do support it?
Definition at line 49 of file SDLOutputSurface.hh.
References getSDLSurface().
|
inline |
Definition at line 36 of file SDLOutputSurface.hh.
Referenced by openmsx::SDLVisibleSurface::finish(), openmsx::SDLVisibleSurface::flushFrameBuffer(), and openmsx::SDLVisibleSurface::saveScreenshotSDL().
|
inline |
Definition at line 35 of file SDLOutputSurface.hh.
Referenced by getDirectPixelAccess().
|
delete |
|
protected |
Definition at line 24 of file SDLOutputSurface.cc.
References openmsx::DiskImageUtils::format(), openmsx::OutputSurface::setPixelFormat(), and UNREACHABLE.
Referenced by openmsx::SDLOffScreenSurface::SDLOffScreenSurface(), and openmsx::SDLVisibleSurface::SDLVisibleSurface().
|
inlineprotected |
Definition at line 69 of file SDLOutputSurface.hh.
Referenced by openmsx::SDLOffScreenSurface::SDLOffScreenSurface(), and openmsx::SDLVisibleSurface::SDLVisibleSurface().
|
inlineprotected |
Definition at line 68 of file SDLOutputSurface.hh.
Referenced by openmsx::SDLOffScreenSurface::SDLOffScreenSurface(), and openmsx::SDLVisibleSurface::SDLVisibleSurface().