openMSX
SDLVideoSystem.hh
Go to the documentation of this file.
1 #ifndef SDLVIDEOSYSTEM_HH
2 #define SDLVIDEOSYSTEM_HH
3 
4 #include "VideoSystem.hh"
5 #include "EventListener.hh"
6 #include "gl_vec.hh"
7 #include "Observer.hh"
8 #include "components.hh"
9 #include <memory>
10 
11 namespace openmsx {
12 
13 class Reactor;
14 class CommandConsole;
15 class Display;
16 class RenderSettings;
17 class VisibleSurface;
18 class Layer;
19 class Setting;
20 
21 class SDLVideoSystem final : public VideoSystem, private EventListener
22  , private Observer<Setting>
23 {
24 public:
28  explicit SDLVideoSystem(Reactor& reactor, CommandConsole& console);
29 
32  ~SDLVideoSystem() override;
33 
34  // VideoSystem interface:
35  std::unique_ptr<Rasterizer> createRasterizer(VDP& vdp) override;
36  std::unique_ptr<V9990Rasterizer> createV9990Rasterizer(
37  V9990& vdp) override;
38 #if COMPONENT_LASERDISC
39  std::unique_ptr<LDRasterizer> createLDRasterizer(
40  LaserdiscPlayer& ld) override;
41 #endif
42  bool checkSettings() override;
43  void flush() override;
44  void takeScreenShot(const std::string& filename, bool withOsd) override;
45  void updateWindowTitle() override;
46  OutputSurface* getOutputSurface() override;
47 
48 private:
49  // EventListener
50  int signalEvent(const std::shared_ptr<const Event>& event) override;
51  // Observer
52  void update(const Setting& subject) override;
53 
54  gl::ivec2 getWindowSize();
55  void resize();
56 
57  Reactor& reactor;
58  Display& display;
59  RenderSettings& renderSettings;
60  std::unique_ptr<VisibleSurface> screen;
61  std::unique_ptr<Layer> consoleLayer;
62  std::unique_ptr<Layer> snowLayer;
63  std::unique_ptr<Layer> iconLayer;
64  std::unique_ptr<Layer> osdGuiLayer;
65 };
66 
67 } // namespace openmsx
68 
69 #endif
Implementation of the Yamaha V9990 VDP as used in the GFX9000 cartridge by Sunrise.
Definition: V9990.hh:29
Contains the main loop of openMSX.
Definition: Reactor.hh:66
std::unique_ptr< V9990Rasterizer > createV9990Rasterizer(V9990 &vdp) override
Create the V9990 rasterizer selected by the current renderer setting.
Represents the output window/screen of openMSX.
Definition: Display.hh:31
A frame buffer where pixels can be written to.
bool checkSettings() override
Requests that this renderer checks its settings against the current RenderSettings.
~SDLVideoSystem() override
Deactivates this video system.
void takeScreenShot(const std::string &filename, bool withOsd) override
Take a screenshot.
std::unique_ptr< Rasterizer > createRasterizer(VDP &vdp) override
Create the rasterizer selected by the current renderer setting.
Video back-end system.
Definition: VideoSystem.hh:20
Thanks to enen for testing this on a real cartridge:
Definition: Autofire.cc:5
OutputSurface * getOutputSurface() override
TODO.
Unified implementation of MSX Video Display Processors (VDPs).
Definition: VDP.hh:61
Class containing all settings for renderers.
SDLVideoSystem(Reactor &reactor, CommandConsole &console)
Activates this video system.
Generic Gang-of-Four Observer class, templatized edition.
Definition: Observer.hh:9
void updateWindowTitle() override
Called when the window title string has changed.
void flush() override
Finish pending drawing operations and make them visible to the user.