openMSX
Public Member Functions | Static Public Member Functions | List of all members
openmsx::SDLGLVisibleSurface Class Referencefinal

Visible surface for SDL openGL renderers. More...

#include <SDLGLVisibleSurface.hh>

Inheritance diagram for openmsx::SDLGLVisibleSurface:
Inheritance graph
[legend]
Collaboration diagram for openmsx::SDLGLVisibleSurface:
Collaboration graph
[legend]

Public Member Functions

 SDLGLVisibleSurface (unsigned width, unsigned height, Display &display, RTScheduler &rtScheduler, EventDistributor &eventDistributor, InputEventGenerator &inputEventGenerator, CliComm &cliComm, VideoSystem &videoSystem)
 
 ~SDLGLVisibleSurface () override
 
void saveScreenshot (const std::string &filename) override
 Save the content of this OutputSurface to a PNG file. More...
 
void finish () override
 When a complete frame is finished, call this method. More...
 
std::unique_ptr< LayercreateSnowLayer () override
 
std::unique_ptr< LayercreateConsoleLayer (Reactor &reactor, CommandConsole &console) override
 
std::unique_ptr< LayercreateOSDGUILayer (OSDGUI &gui) override
 
std::unique_ptr< OutputSurfacecreateOffScreenSurface () override
 Create an off-screen OutputSurface which has similar properties as this VisibleSurface. More...
 
- Public Member Functions inherited from openmsx::SDLVisibleSurfaceBase
void updateWindowTitle () override
 
bool setFullScreen (bool fullscreen) override
 
- Public Member Functions inherited from openmsx::SDLOutputSurface
 SDLOutputSurface (const SDLOutputSurface &)=delete
 
SDLOutputSurfaceoperator= (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
 
OutputSurfaceoperator= (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 PixelFormatgetPixelFormat () 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...
 
- Public Member Functions inherited from openmsx::VisibleSurface
virtual ~VisibleSurface ()
 
CliCommgetCliComm () const
 
DisplaygetDisplay () const
 

Static Public Member Functions

static void saveScreenshotGL (const OutputSurface &output, const std::string &filename)
 

Additional Inherited Members

- Protected Member Functions inherited from openmsx::SDLVisibleSurfaceBase
void createSurface (int width, int height, unsigned flags)
 
 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 inherited from openmsx::SDLVisibleSurfaceBase
SDLSubSystemInitializer< SDL_INIT_VIDEO > videoSubSystem
 
SDLWindowPtr window
 

Detailed Description

Visible surface for SDL openGL renderers.

Definition at line 10 of file SDLGLVisibleSurface.hh.

Constructor & Destructor Documentation

◆ SDLGLVisibleSurface()

openmsx::SDLGLVisibleSurface::SDLGLVisibleSurface ( unsigned  width,
unsigned  height,
Display display,
RTScheduler rtScheduler,
EventDistributor eventDistributor,
InputEventGenerator inputEventGenerator,
CliComm cliComm,
VideoSystem videoSystem 
)

◆ ~SDLGLVisibleSurface()

openmsx::SDLGLVisibleSurface::~SDLGLVisibleSurface ( )
override

Definition at line 84 of file SDLGLVisibleSurface.cc.

References gl::context.

Member Function Documentation

◆ createConsoleLayer()

std::unique_ptr< Layer > openmsx::SDLGLVisibleSurface::createConsoleLayer ( Reactor reactor,
CommandConsole console 
)
overridevirtual

◆ createOffScreenSurface()

std::unique_ptr< OutputSurface > openmsx::SDLGLVisibleSurface::createOffScreenSurface ( )
overridevirtual

Create an off-screen OutputSurface which has similar properties as this VisibleSurface.

E.g. used to re-render the current frame without OSD elements to take a screenshot.

Implements openmsx::VisibleSurface.

Definition at line 134 of file SDLGLVisibleSurface.cc.

◆ createOSDGUILayer()

std::unique_ptr< Layer > openmsx::SDLGLVisibleSurface::createOSDGUILayer ( OSDGUI gui)
overridevirtual

Implements openmsx::VisibleSurface.

Definition at line 129 of file SDLGLVisibleSurface.cc.

◆ createSnowLayer()

std::unique_ptr< Layer > openmsx::SDLGLVisibleSurface::createSnowLayer ( )
overridevirtual

Implements openmsx::VisibleSurface.

Definition at line 115 of file SDLGLVisibleSurface.cc.

References openmsx::VisibleSurface::getDisplay().

◆ finish()

void openmsx::SDLGLVisibleSurface::finish ( )
overridevirtual

When a complete frame is finished, call this method.

It will 'actually' display it. E.g. when using double buffering it will swap the front and back buffer.

Implements openmsx::VisibleSurface.

Definition at line 110 of file SDLGLVisibleSurface.cc.

References openmsx::SDLVisibleSurfaceBase::window.

◆ saveScreenshot()

void openmsx::SDLGLVisibleSurface::saveScreenshot ( const std::string &  filename)
overridevirtual

Save the content of this OutputSurface to a PNG file.

Exceptions
MSXExceptionIf creating the PNG file fails.

Implements openmsx::OutputSurface.

Definition at line 90 of file SDLGLVisibleSurface.cc.

References openmsx::filename, and saveScreenshotGL().

◆ saveScreenshotGL()

void openmsx::SDLGLVisibleSurface::saveScreenshotGL ( const OutputSurface output,
const std::string &  filename 
)
static

The documentation for this class was generated from the following files: