openMSX
SDLVisibleSurface.hh
Go to the documentation of this file.
1 #ifndef SDLVISIBLESURFACE_HH
2 #define SDLVISIBLESURFACE_HH
3 
5 
6 namespace openmsx {
7 
9 {
10 public:
11  SDLVisibleSurface(unsigned width, unsigned height,
12  Display& display,
13  RTScheduler& rtScheduler,
14  EventDistributor& eventDistributor,
15  InputEventGenerator& inputEventGenerator,
16  CliComm& cliComm,
17  VideoSystem& videoSystem);
18 
19  static void saveScreenshotSDL(const SDLOutputSurface& output,
20  const std::string& filename);
21 
22  // OutputSurface
23  void saveScreenshot(const std::string& filename) override;
24  void flushFrameBuffer() override;
25  void clearScreen() override;
26 
27  // VisibleSurface
28  void finish() override;
29  [[nodiscard]] std::unique_ptr<Layer> createSnowLayer() override;
30  [[nodiscard]] std::unique_ptr<Layer> createConsoleLayer(
31  Reactor& reactor, CommandConsole& console) override;
32  [[nodiscard]] std::unique_ptr<Layer> createOSDGUILayer(OSDGUI& gui) override;
33  [[nodiscard]] std::unique_ptr<OutputSurface> createOffScreenSurface() override;
34  void fullScreenUpdated(bool fullscreen) override;
35 
36 private:
37  SDLRendererPtr renderer;
38  SDLSurfacePtr surface;
39  SDLTexturePtr texture;
40 };
41 
42 } // namespace openmsx
43 
44 #endif
openmsx::SDLVisibleSurface::saveScreenshotSDL
static void saveScreenshotSDL(const SDLOutputSurface &output, const std::string &filename)
Definition: SDLVisibleSurface.cc:115
openmsx::SDLVisibleSurfaceBase
Common functionality for the plain SDL and SDLGL VisibleSurface classes.
Definition: SDLVisibleSurfaceBase.hh:13
openmsx::InputEventGenerator
Definition: InputEventGenerator.hh:18
openmsx::SDLVisibleSurface::SDLVisibleSurface
SDLVisibleSurface(unsigned width, unsigned height, Display &display, RTScheduler &rtScheduler, EventDistributor &eventDistributor, InputEventGenerator &inputEventGenerator, CliComm &cliComm, VideoSystem &videoSystem)
Definition: SDLVisibleSurface.cc:16
SDLSurfacePtr
Wrapper around a SDL_Surface.
Definition: SDLSurfacePtr.hh:34
openmsx::SDLVisibleSurface::flushFrameBuffer
void flushFrameBuffer() override
Copy frame buffer to display buffer.
Definition: SDLVisibleSurface.cc:62
openmsx::RTScheduler
Definition: RTScheduler.hh:20
openmsx::VideoSystem
Video back-end system.
Definition: VideoSystem.hh:21
openmsx::EventDistributor
Definition: EventDistributor.hh:17
openmsx::SDLVisibleSurface::createSnowLayer
std::unique_ptr< Layer > createSnowLayer() override
Definition: SDLVisibleSurface.cc:75
openmsx::SDLVisibleSurface::clearScreen
void clearScreen() override
Clear frame buffer (paint it black).
Definition: SDLVisibleSurface.cc:132
SDLRendererPtr
std::unique_ptr< SDL_Renderer, SDLDestroyRenderer > SDLRendererPtr
Definition: SDLSurfacePtr.hh:147
openmsx::SDLVisibleSurface::createOffScreenSurface
std::unique_ptr< OutputSurface > createOffScreenSurface() override
Create an off-screen OutputSurface which has similar properties as this VisibleSurface.
Definition: SDLVisibleSurface.cc:105
openmsx::SDLVisibleSurface
Definition: SDLVisibleSurface.hh:9
openmsx::SDLVisibleSurface::saveScreenshot
void saveScreenshot(const std::string &filename) override
Save the content of this OutputSurface to a PNG file.
Definition: SDLVisibleSurface.cc:110
openmsx::SDLVisibleSurface::fullScreenUpdated
void fullScreenUpdated(bool fullscreen) override
Definition: SDLVisibleSurface.cc:137
openmsx::Reactor
Contains the main loop of openMSX.
Definition: Reactor.hh:67
openmsx::OSDGUI
Definition: OSDGUI.hh:14
openmsx::SDLOutputSurface
A frame buffer where pixels can be written to.
Definition: SDLOutputSurface.hh:30
openmsx::filename
constexpr const char *const filename
Definition: FirmwareSwitch.cc:10
openmsx::SDLVisibleSurface::finish
void finish() override
When a complete frame is finished, call this method.
Definition: SDLVisibleSurface.cc:70
SDLTexturePtr
std::unique_ptr< SDL_Texture, SDLDestroyTexture > SDLTexturePtr
Definition: SDLSurfacePtr.hh:141
SDLVisibleSurfaceBase.hh
openmsx::Display
Represents the output window/screen of openMSX.
Definition: Display.hh:33
openmsx::CliComm
Definition: CliComm.hh:11
openmsx::SDLVisibleSurface::createConsoleLayer
std::unique_ptr< Layer > createConsoleLayer(Reactor &reactor, CommandConsole &console) override
Definition: SDLVisibleSurface.cc:91
openmsx::SDLVisibleSurface::createOSDGUILayer
std::unique_ptr< Layer > createOSDGUILayer(OSDGUI &gui) override
Definition: SDLVisibleSurface.cc:100
openmsx
This file implemented 3 utility functions:
Definition: Autofire.cc:5
openmsx::CommandConsole
Definition: CommandConsole.hh:60