openMSX
SDLVisibleSurface.hh
Go to the documentation of this file.
1#ifndef SDLVISIBLESURFACE_HH
2#define SDLVISIBLESURFACE_HH
3
5
6namespace openmsx {
7
9{
10public:
11 SDLVisibleSurface(int width, int 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
36private:
37 SDLRendererPtr renderer;
38 SDLSurfacePtr surface;
39 SDLTexturePtr texture;
40};
41
42} // namespace openmsx
43
44#endif
std::unique_ptr< SDL_Renderer, SDLDestroyRenderer > SDLRendererPtr
std::unique_ptr< SDL_Texture, SDLDestroyTexture > SDLTexturePtr
Wrapper around a SDL_Surface.
Represents the output window/screen of openMSX.
Definition: Display.hh:33
Contains the main loop of openMSX.
Definition: Reactor.hh:68
A frame buffer where pixels can be written to.
Common functionality for the plain SDL and SDLGL VisibleSurface classes.
void finish() override
When a complete frame is finished, call this method.
void saveScreenshot(const std::string &filename) override
Save the content of this OutputSurface to a PNG file.
SDLVisibleSurface(int width, int height, Display &display, RTScheduler &rtScheduler, EventDistributor &eventDistributor, InputEventGenerator &inputEventGenerator, CliComm &cliComm, VideoSystem &videoSystem)
std::unique_ptr< Layer > createConsoleLayer(Reactor &reactor, CommandConsole &console) override
static void saveScreenshotSDL(const SDLOutputSurface &output, const std::string &filename)
std::unique_ptr< Layer > createSnowLayer() override
void flushFrameBuffer() override
Copy frame buffer to display buffer.
std::unique_ptr< OutputSurface > createOffScreenSurface() override
Create an off-screen OutputSurface which has similar properties as this VisibleSurface.
std::unique_ptr< Layer > createOSDGUILayer(OSDGUI &gui) override
void fullScreenUpdated(bool fullScreen) override
void clearScreen() override
Clear frame buffer (paint it black).
Video back-end system.
Definition: VideoSystem.hh:23
This file implemented 3 utility functions:
Definition: Autofire.cc:9