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

An OutputSurface which is visible to the user, such as a window or a full screen display. More...

#include <VisibleSurface.hh>

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

Public Member Functions

 VisibleSurface (Display &display, RTScheduler &rtScheduler, EventDistributor &eventDistributor, InputEventGenerator &inputEventGenerator, CliComm &cliComm, VideoSystem &videoSystem)
 
 ~VisibleSurface () override
 
CliCommgetCliComm () const
 
DisplaygetDisplay () const
 
void updateWindowTitle ()
 
bool setFullScreen (bool fullscreen)
 
void resize ()
 
void finish ()
 When a complete frame is finished, call this method.
 
std::unique_ptr< LayercreateSnowLayer ()
 
std::unique_ptr< LayercreateOSDGUILayer (OSDGUI &gui)
 
std::unique_ptr< LayercreateImGUILayer (ImGuiManager &manager)
 
std::unique_ptr< OutputSurfacecreateOffScreenSurface ()
 Create an off-screen OutputSurface which has similar properties as this VisibleSurface.
 
void fullScreenUpdated (bool fullScreen)
 
std::optional< gl::ivec2getWindowPosition () const
 Returns x,y coordinates of top-left window corner, or returns a nullopt when in fullscreen mode.
 
void setWindowPosition (gl::ivec2 pos)
 
void saveScreenshot (const std::string &filename) override
 Save the content of this OutputSurface to a PNG file.
 
void update (const Setting &setting) noexcept override
 
bool signalEvent (const Event &event) override
 This method gets called when an event you are subscribed to occurs.
 
void executeRT () override
 
- Public Member Functions inherited from openmsx::OutputSurface
 OutputSurface (const OutputSurface &)=delete
 
 OutputSurface (OutputSurface &&)=delete
 
OutputSurfaceoperator= (const OutputSurface &)=delete
 
OutputSurfaceoperator= (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
 
uint32_t mapRGB (gl::vec3 rgb) const
 Returns the pixel value for the given RGB color.
 
uint32_t mapRGB255 (gl::ivec3 rgb) const
 Same as mapRGB, but RGB components are in range [0..255].
 
Pixel getKeyColor () const
 Returns the color key for this output surface.
 
- Public Member Functions inherited from openmsx::EventListener
 EventListener (const EventListener &)=delete
 
 EventListener (EventListener &&)=delete
 
EventListeneroperator= (const EventListener &)=delete
 
EventListeneroperator= (EventListener &&)=delete
 

Static Public Member Functions

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

Additional Inherited Members

- Public Types inherited from openmsx::OutputSurface
using Pixel = uint32_t
 
- Protected Member Functions inherited from openmsx::OutputSurface
 OutputSurface ()=default
 
void calculateViewPort (gl::ivec2 logSize, gl::ivec2 physSize)
 
- Protected Member Functions inherited from openmsx::EventListener
 EventListener ()=default
 
 ~EventListener ()=default
 

Detailed Description

An OutputSurface which is visible to the user, such as a window or a full screen display.

Definition at line 28 of file VisibleSurface.hh.

Constructor & Destructor Documentation

◆ VisibleSurface()

openmsx::VisibleSurface::VisibleSurface ( Display display,
RTScheduler rtScheduler,
EventDistributor eventDistributor,
InputEventGenerator inputEventGenerator,
CliComm cliComm,
VideoSystem videoSystem 
)

◆ ~VisibleSurface()

openmsx::VisibleSurface::~VisibleSurface ( )
override

Member Function Documentation

◆ createImGUILayer()

std::unique_ptr< Layer > openmsx::VisibleSurface::createImGUILayer ( ImGuiManager manager)

Definition at line 378 of file VisibleSurface.cc.

◆ createOffScreenSurface()

std::unique_ptr< OutputSurface > openmsx::VisibleSurface::createOffScreenSurface ( )

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.

Definition at line 383 of file VisibleSurface.cc.

◆ createOSDGUILayer()

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

Definition at line 373 of file VisibleSurface.cc.

◆ createSnowLayer()

std::unique_ptr< Layer > openmsx::VisibleSurface::createSnowLayer ( )

Definition at line 368 of file VisibleSurface.cc.

References getDisplay().

◆ executeRT()

void openmsx::VisibleSurface::executeRT ( )
overridevirtual

◆ finish()

void openmsx::VisibleSurface::finish ( )

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.

Definition at line 363 of file VisibleSurface.cc.

◆ fullScreenUpdated()

void openmsx::VisibleSurface::fullScreenUpdated ( bool  fullScreen)

Definition at line 436 of file VisibleSurface.cc.

References openmsx::OutputSurface::getLogicalSize().

Referenced by setFullScreen().

◆ getCliComm()

CliComm & openmsx::VisibleSurface::getCliComm ( ) const
inline

Definition at line 40 of file VisibleSurface.hh.

◆ getDisplay()

Display & openmsx::VisibleSurface::getDisplay ( ) const
inline

Definition at line 41 of file VisibleSurface.hh.

Referenced by createSnowLayer(), and updateWindowTitle().

◆ getWindowPosition()

std::optional< gl::ivec2 > openmsx::VisibleSurface::getWindowPosition ( ) const

Returns x,y coordinates of top-left window corner, or returns a nullopt when in fullscreen mode.

Definition at line 185 of file VisibleSurface.cc.

Referenced by ~VisibleSurface().

◆ resize()

void openmsx::VisibleSurface::resize ( )

◆ saveScreenshot()

void openmsx::VisibleSurface::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 340 of file VisibleSurface.cc.

References saveScreenshotGL().

◆ saveScreenshotGL()

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

◆ setFullScreen()

bool openmsx::VisibleSurface::setFullScreen ( bool  fullscreen)

Definition at line 306 of file VisibleSurface.cc.

References fullScreenUpdated().

◆ setWindowPosition()

void openmsx::VisibleSurface::setWindowPosition ( gl::ivec2  pos)

Definition at line 193 of file VisibleSurface.cc.

◆ signalEvent()

bool openmsx::VisibleSurface::signalEvent ( const Event event)
overridevirtual

This method gets called when an event you are subscribed to occurs.

Returns
Return true when this event must be blocked from listeners with a (strictly) lower priority.

Implements openmsx::EventListener.

Definition at line 272 of file VisibleSurface.cc.

References openmsx::getType(), and openmsx::IMGUI_ACTIVE.

◆ update()

void openmsx::VisibleSurface::update ( const Setting setting)
overridevirtualnoexcept

Implements openmsx::Observer< Setting >.

Definition at line 260 of file VisibleSurface.cc.

◆ updateWindowTitle()

void openmsx::VisibleSurface::updateWindowTitle ( )

Definition at line 334 of file VisibleSurface.cc.

References getDisplay().


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