openMSX
|
Common functionality for the plain SDL and SDLGL VisibleSurface classes. More...
#include <SDLVisibleSurfaceBase.hh>
Public Member Functions | |
void | updateWindowTitle () override |
bool | setFullScreen (bool fullscreen) override |
~SDLVisibleSurfaceBase () override | |
Public Member Functions inherited from openmsx::SDLOutputSurface | |
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... | |
Public Member Functions inherited from openmsx::OutputSurface | |
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<std::unsigned_integral Pixel> | |
Pixel | getKeyColor () const |
Returns the color key for this output surface. More... | |
template<std::unsigned_integral Pixel> | |
Pixel | getKeyColorClash () const |
Returns a color that is visually very close to the key color. More... | |
template<std::unsigned_integral Pixel> | |
Pixel | mapKeyedRGB255 (gl::ivec3 rgb) |
Returns the pixel value for the given RGB color. More... | |
template<std::unsigned_integral 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... | |
Public Member Functions inherited from openmsx::VisibleSurface | |
virtual | ~VisibleSurface () |
virtual void | updateWindowTitle ()=0 |
virtual bool | setFullScreen (bool fullscreen)=0 |
virtual void | finish ()=0 |
When a complete frame is finished, call this method. More... | |
virtual std::unique_ptr< Layer > | createSnowLayer ()=0 |
virtual std::unique_ptr< Layer > | createConsoleLayer (Reactor &reactor, CommandConsole &console)=0 |
virtual std::unique_ptr< Layer > | createOSDGUILayer (OSDGUI &gui)=0 |
virtual std::unique_ptr< OutputSurface > | createOffScreenSurface ()=0 |
Create an off-screen OutputSurface which has similar properties as this VisibleSurface. More... | |
CliComm & | getCliComm () const |
Display & | getDisplay () const |
Public Member Functions inherited from openmsx::EventListener | |
EventListener (const EventListener &)=delete | |
EventListener & | operator= (const EventListener &)=delete |
virtual int | signalEvent (const Event &event)=0 |
This method gets called when an event you are subscribed to occurs. More... | |
Protected Member Functions | |
void | createSurface (int width, int height, unsigned flags) |
virtual void | fullScreenUpdated (bool fullscreen)=0 |
VisibleSurface (Display &display, RTScheduler &rtScheduler, EventDistributor &eventDistributor, InputEventGenerator &inputEventGenerator, CliComm &cliComm, VideoSystem &videoSystem) | |
Protected Member Functions inherited from openmsx::SDLOutputSurface | |
SDLOutputSurface ()=default | |
void | setSDLPixelFormat (const SDL_PixelFormat &format) |
void | setSDLSurface (SDL_Surface *surface_) |
void | setSDLRenderer (SDL_Renderer *r) |
Protected Member Functions inherited from openmsx::OutputSurface | |
OutputSurface ()=default | |
void | calculateViewPort (gl::ivec2 logSize, gl::ivec2 physSize) |
void | setPixelFormat (const PixelFormat &format) |
void | setOpenGlPixelFormat () |
Protected Member Functions inherited from openmsx::VisibleSurface | |
VisibleSurface (Display &display, RTScheduler &rtScheduler, EventDistributor &eventDistributor, InputEventGenerator &inputEventGenerator, CliComm &cliComm, VideoSystem &videoSystem) | |
Protected Member Functions inherited from openmsx::EventListener | |
EventListener ()=default | |
~EventListener ()=default | |
Protected Attributes | |
SDLSubSystemInitializer< SDL_INIT_VIDEO > | videoSubSystem |
SDLWindowPtr | window |
Common functionality for the plain SDL and SDLGL VisibleSurface classes.
Definition at line 12 of file SDLVisibleSurfaceBase.hh.
|
override |
Definition at line 19 of file SDLVisibleSurfaceBase.cc.
References window.
|
protected |
Definition at line 32 of file SDLVisibleSurfaceBase.cc.
References Endian::BIG, openmsx::OpenMSX_Icon::bytes_per_pixel, Math::e, SDLSurfacePtr::get(), openmsx::VisibleSurface::getCliComm(), openmsx::VisibleSurface::getDisplay(), openmsx::OpenMSX_Icon::height, openmsx::PNG::load(), openmsx::openMSX_icon, openmsx::OpenMSX_Icon::pixel_data, openmsx::preferSystemFileContext(), openmsx::CliComm::printWarning(), SDLSurfacePtr::reset(), updateWindowTitle(), openmsx::OpenMSX_Icon::width, and window.
Referenced by openmsx::SDLGLVisibleSurface::SDLGLVisibleSurface(), and openmsx::SDLVisibleSurface::SDLVisibleSurface().
|
protectedpure virtual |
Implemented in openmsx::SDLGLVisibleSurface, and openmsx::SDLVisibleSurface.
Referenced by setFullScreen().
|
overridevirtual |
Implements openmsx::VisibleSurface.
Definition at line 94 of file SDLVisibleSurfaceBase.cc.
References fullScreenUpdated(), and window.
|
overridevirtual |
Implements openmsx::VisibleSurface.
Definition at line 88 of file SDLVisibleSurfaceBase.cc.
References openmsx::VisibleSurface::getDisplay(), and window.
Referenced by createSurface().
|
protected |
Definition at line 55 of file VisibleSurface.cc.
|
protected |
Definition at line 25 of file SDLVisibleSurfaceBase.hh.
|
protected |
Definition at line 26 of file SDLVisibleSurfaceBase.hh.
Referenced by createSurface(), openmsx::SDLGLVisibleSurface::finish(), openmsx::SDLGLVisibleSurface::SDLGLVisibleSurface(), openmsx::SDLVisibleSurface::SDLVisibleSurface(), setFullScreen(), updateWindowTitle(), and ~SDLVisibleSurfaceBase().