openMSX
SDLGLVisibleSurface.hh
Go to the documentation of this file.
1 #ifndef SDLGLVISIBLESURFACE_HH
2 #define SDLGLVISIBLESURFACE_HH
3 
5 
6 namespace openmsx {
7 
11 {
12 public:
13  SDLGLVisibleSurface(unsigned width, unsigned height,
14  Display& display,
15  RTScheduler& rtScheduler,
16  EventDistributor& eventDistributor,
17  InputEventGenerator& inputEventGenerator,
18  CliComm& cliComm,
19  VideoSystem& videoSystem);
20  ~SDLGLVisibleSurface() override;
21 
22  static void saveScreenshotGL(const OutputSurface& output,
23  const std::string& filename);
24 
25  // OutputSurface
26  void saveScreenshot(const std::string& filename) override;
27 
28  // VisibleSurface
29  void finish() override;
30  [[nodiscard]] std::unique_ptr<Layer> createSnowLayer() override;
31  [[nodiscard]] std::unique_ptr<Layer> createConsoleLayer(
32  Reactor& reactor, CommandConsole& console) override;
33  [[nodiscard]] std::unique_ptr<Layer> createOSDGUILayer(OSDGUI& gui) override;
34  [[nodiscard]] std::unique_ptr<OutputSurface> createOffScreenSurface() override;
35  void fullScreenUpdated(bool fullscreen) override;
36 
37 private:
38  void setViewPort(gl::ivec2 logicalSize, bool fullscreen);
39 
40 private:
41  struct VSyncObserver : openmsx::Observer<Setting> {
42  void update(const Setting& setting) noexcept override;
43  } vSyncObserver;
44 
45  SDL_GLContext glContext;
46 };
47 
48 } // namespace openmsx
49 
50 #endif
BaseSetting * setting
Definition: Interpreter.cc:27
Represents the output window/screen of openMSX.
Definition: Display.hh:33
Generic Gang-of-Four Observer class, templatized edition.
Definition: Observer.hh:10
A frame buffer where pixels can be written to.
Contains the main loop of openMSX.
Definition: Reactor.hh:68
Visible surface for SDL openGL renderers.
void saveScreenshot(const std::string &filename) override
Save the content of this OutputSurface to a PNG file.
std::unique_ptr< Layer > createSnowLayer() override
std::unique_ptr< OutputSurface > createOffScreenSurface() override
Create an off-screen OutputSurface which has similar properties as this VisibleSurface.
std::unique_ptr< Layer > createConsoleLayer(Reactor &reactor, CommandConsole &console) override
std::unique_ptr< Layer > createOSDGUILayer(OSDGUI &gui) override
void fullScreenUpdated(bool fullscreen) override
void finish() override
When a complete frame is finished, call this method.
static void saveScreenshotGL(const OutputSurface &output, const std::string &filename)
SDLGLVisibleSurface(unsigned width, unsigned height, Display &display, RTScheduler &rtScheduler, EventDistributor &eventDistributor, InputEventGenerator &inputEventGenerator, CliComm &cliComm, VideoSystem &videoSystem)
Common functionality for the plain SDL and SDLGL VisibleSurface classes.
Video back-end system.
Definition: VideoSystem.hh:23
This file implemented 3 utility functions:
Definition: Autofire.cc:9
constexpr const char *const filename