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  std::unique_ptr<Layer> createSnowLayer() override;
30  std::unique_ptr<Layer> createConsoleLayer(
31  Reactor& reactor, CommandConsole& console) override;
32  std::unique_ptr<Layer> createOSDGUILayer(OSDGUI& gui) override;
33  std::unique_ptr<OutputSurface> createOffScreenSurface() override;
34 
35 private:
36  SDLRendererPtr renderer;
37  SDLSurfacePtr surface;
38  SDLTexturePtr texture;
39 };
40 
41 } // namespace openmsx
42 
43 #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:12
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:33
openmsx::SDLVisibleSurface::flushFrameBuffer
void flushFrameBuffer() override
Copy frame buffer to display buffer.
Definition: SDLVisibleSurface.cc:62
openmsx::RTScheduler
Definition: RTScheduler.hh:19
openmsx::VideoSystem
Video back-end system.
Definition: VideoSystem.hh:20
openmsx::EventDistributor
Definition: EventDistributor.hh:16
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:8
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::Reactor
Contains the main loop of openMSX.
Definition: Reactor.hh:66
openmsx::OSDGUI
Definition: OSDGUI.hh:13
openmsx::SDLOutputSurface
A frame buffer where pixels can be written to.
Definition: SDLOutputSurface.hh:29
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:31
openmsx::CliComm
Definition: CliComm.hh:10
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
Thanks to enen for testing this on a real cartridge:
Definition: Autofire.cc:5
openmsx::CommandConsole
Definition: CommandConsole.hh:64