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  std::unique_ptr<Layer> createSnowLayer() override;
31  std::unique_ptr<Layer> createConsoleLayer(
32  Reactor& reactor, CommandConsole& console) override;
33  std::unique_ptr<Layer> createOSDGUILayer(OSDGUI& gui) override;
34  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) override;
43  } vSyncObserver;
44 
45  SDL_GLContext glContext;
46 };
47 
48 } // namespace openmsx
49 
50 #endif
openmsx::SDLGLVisibleSurface::saveScreenshotGL
static void saveScreenshotGL(const OutputSurface &output, const std::string &filename)
Definition: SDLGLVisibleSurface.cc:118
openmsx::SDLVisibleSurfaceBase
Common functionality for the plain SDL and SDLGL VisibleSurface classes.
Definition: SDLVisibleSurfaceBase.hh:13
openmsx::SDLGLVisibleSurface::finish
void finish() override
When a complete frame is finished, call this method.
Definition: SDLGLVisibleSurface.cc:145
openmsx::InputEventGenerator
Definition: InputEventGenerator.hh:18
openmsx::SDLGLVisibleSurface::createOSDGUILayer
std::unique_ptr< Layer > createOSDGUILayer(OSDGUI &gui) override
Definition: SDLGLVisibleSurface.cc:164
openmsx::SDLGLVisibleSurface
Visible surface for SDL openGL renderers.
Definition: SDLGLVisibleSurface.hh:11
openmsx::SDLGLVisibleSurface::createConsoleLayer
std::unique_ptr< Layer > createConsoleLayer(Reactor &reactor, CommandConsole &console) override
Definition: SDLGLVisibleSurface.cc:155
openmsx::RTScheduler
Definition: RTScheduler.hh:20
openmsx::VideoSystem
Video back-end system.
Definition: VideoSystem.hh:21
openmsx::SDLGLVisibleSurface::createSnowLayer
std::unique_ptr< Layer > createSnowLayer() override
Definition: SDLGLVisibleSurface.cc:150
openmsx::Setting
Definition: Setting.hh:120
openmsx::EventDistributor
Definition: EventDistributor.hh:17
gl::vecN
Definition: gl_vec.hh:36
openmsx::Reactor
Contains the main loop of openMSX.
Definition: Reactor.hh:67
openmsx::OSDGUI
Definition: OSDGUI.hh:14
openmsx::SDLGLVisibleSurface::fullScreenUpdated
void fullScreenUpdated(bool fullscreen) override
Definition: SDLGLVisibleSurface.cc:217
openmsx::filename
constexpr const char *const filename
Definition: FirmwareSwitch.cc:10
openmsx::SDLGLVisibleSurface::SDLGLVisibleSurface
SDLGLVisibleSurface(unsigned width, unsigned height, Display &display, RTScheduler &rtScheduler, EventDistributor &eventDistributor, InputEventGenerator &inputEventGenerator, CliComm &cliComm, VideoSystem &videoSystem)
Definition: SDLGLVisibleSurface.cc:23
openmsx::SDLGLVisibleSurface::saveScreenshot
void saveScreenshot(const std::string &filename) override
Save the content of this OutputSurface to a PNG file.
Definition: SDLGLVisibleSurface.cc:113
SDLVisibleSurfaceBase.hh
openmsx::Display
Represents the output window/screen of openMSX.
Definition: Display.hh:33
openmsx::SDLGLVisibleSurface::~SDLGLVisibleSurface
~SDLGLVisibleSurface() override
Definition: SDLGLVisibleSurface.cc:105
openmsx::OutputSurface
A frame buffer where pixels can be written to.
Definition: OutputSurface.hh:20
openmsx::CliComm
Definition: CliComm.hh:11
openmsx
This file implemented 3 utility functions:
Definition: Autofire.cc:5
openmsx::SDLGLVisibleSurface::createOffScreenSurface
std::unique_ptr< OutputSurface > createOffScreenSurface() override
Create an off-screen OutputSurface which has similar properties as this VisibleSurface.
Definition: SDLGLVisibleSurface.cc:169
openmsx::Observer
Generic Gang-of-Four Observer class, templatized edition.
Definition: Observer.hh:10
openmsx::CommandConsole
Definition: CommandConsole.hh:60