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 SDLVisibleSurfaceBase;
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  [[nodiscard]] std::unique_ptr<Rasterizer> createRasterizer(VDP& vdp) override;
36  [[nodiscard]] 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  [[nodiscard]] bool checkSettings() override;
43  void flush() override;
44  void takeScreenShot(const std::string& filename, bool withOsd) override;
45  void updateWindowTitle() override;
46  [[nodiscard]] OutputSurface* getOutputSurface() override;
47  void showCursor(bool show) override;
48  void repaint() override;
49 
50 private:
51  // EventListener
52  int signalEvent(const std::shared_ptr<const Event>& event) override;
53  // Observer
54  void update(const Setting& subject) override;
55 
56  [[nodiscard]] gl::ivec2 getWindowSize();
57  void resize();
58 
59 private:
60  Reactor& reactor;
61  Display& display;
62  RenderSettings& renderSettings;
63  std::unique_ptr<SDLVisibleSurfaceBase> screen;
64  std::unique_ptr<Layer> consoleLayer;
65  std::unique_ptr<Layer> snowLayer;
66  std::unique_ptr<Layer> iconLayer;
67  std::unique_ptr<Layer> osdGuiLayer;
68 };
69 
70 } // namespace openmsx
71 
72 #endif
openmsx::SDLVideoSystem::getOutputSurface
OutputSurface * getOutputSurface() override
TODO.
Definition: SDLVideoSystem.cc:242
VideoSystem.hh
openmsx::SDLVideoSystem::createV9990Rasterizer
std::unique_ptr< V9990Rasterizer > createV9990Rasterizer(V9990 &vdp) override
Create the V9990 rasterizer selected by the current renderer setting.
Definition: SDLVideoSystem.cc:102
openmsx::SDLVideoSystem::createRasterizer
std::unique_ptr< Rasterizer > createRasterizer(VDP &vdp) override
Create the rasterizer selected by the current renderer setting.
Definition: SDLVideoSystem.cc:61
openmsx::VDP
Unified implementation of MSX Video Display Processors (VDPs).
Definition: VDP.hh:63
openmsx::RenderSettings
Class containing all settings for renderers.
Definition: RenderSettings.hh:22
gl_vec.hh
openmsx::SDLVideoSystem::updateWindowTitle
void updateWindowTitle() override
Called when the window title string has changed.
Definition: SDLVideoSystem.cc:237
EventListener.hh
openmsx::VideoSystem
Video back-end system.
Definition: VideoSystem.hh:21
openmsx::SDLVideoSystem::~SDLVideoSystem
~SDLVideoSystem() override
Deactivates this video system.
Definition: SDLVideoSystem.cc:49
openmsx::LaserdiscPlayer
Definition: LaserdiscPlayer.hh:28
openmsx::Setting
Definition: Setting.hh:120
openmsx::SDLVideoSystem
Definition: SDLVideoSystem.hh:23
gl::vecN
Definition: gl_vec.hh:36
openmsx::Reactor
Contains the main loop of openMSX.
Definition: Reactor.hh:67
Observer.hh
openmsx::SDLVideoSystem::showCursor
void showCursor(bool show) override
Definition: SDLVideoSystem.cc:247
openmsx::filename
constexpr const char *const filename
Definition: FirmwareSwitch.cc:10
openmsx::SDLVideoSystem::takeScreenShot
void takeScreenShot(const std::string &filename, bool withOsd) override
Take a screenshot.
Definition: SDLVideoSystem.cc:221
openmsx::EventListener
Definition: EventListener.hh:11
openmsx::SDLVideoSystem::flush
void flush() override
Finish pending drawing operations and make them visible to the user.
Definition: SDLVideoSystem.cc:216
components.hh
openmsx::SDLVideoSystem::repaint
void repaint() override
Definition: SDLVideoSystem.cc:252
openmsx::SDLVideoSystem::checkSettings
bool checkSettings() override
Requests that this renderer checks its settings against the current RenderSettings.
Definition: SDLVideoSystem.cc:205
openmsx::SDLVideoSystem::createLDRasterizer
std::unique_ptr< LDRasterizer > createLDRasterizer(LaserdiscPlayer &ld) override
Definition: SDLVideoSystem.cc:145
openmsx::Display
Represents the output window/screen of openMSX.
Definition: Display.hh:33
openmsx::OutputSurface
A frame buffer where pixels can be written to.
Definition: OutputSurface.hh:20
openmsx::SDLVideoSystem::SDLVideoSystem
SDLVideoSystem(Reactor &reactor, CommandConsole &console)
Activates this video system.
Definition: SDLVideoSystem.cc:29
openmsx
This file implemented 3 utility functions:
Definition: Autofire.cc:5
openmsx::Observer
Generic Gang-of-Four Observer class, templatized edition.
Definition: Observer.hh:10
openmsx::V9990
Implementation of the Yamaha V9990 VDP as used in the GFX9000 cartridge by Sunrise.
Definition: V9990.hh:31
openmsx::CommandConsole
Definition: CommandConsole.hh:60