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
11namespace openmsx {
12
13class Reactor;
14class CommandConsole;
15class Display;
16class RenderSettings;
17class SDLVisibleSurfaceBase;
18class Layer;
19class Setting;
20
21class SDLVideoSystem final : public VideoSystem, private EventListener
22 , private Observer<Setting>
23{
24public:
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]] gl::ivec2 getMouseCoord() override;
47 [[nodiscard]] OutputSurface* getOutputSurface() override;
48 void showCursor(bool show) override;
49 [[nodiscard]] bool getCursorEnabled() override;
50 [[nodiscard]] std::string getClipboardText() override;
51 void setClipboardText(zstring_view text) override;
52 void repaint() override;
53
54private:
55 // EventListener
56 int signalEvent(const Event& event) override;
57 // Observer
58 void update(const Setting& subject) noexcept override;
59
60 [[nodiscard]] gl::ivec2 getWindowSize();
61 void resize();
62
63private:
64 Reactor& reactor;
65 Display& display;
66 RenderSettings& renderSettings;
67 std::unique_ptr<SDLVisibleSurfaceBase> screen;
68 std::unique_ptr<Layer> consoleLayer;
69 std::unique_ptr<Layer> snowLayer;
70 std::unique_ptr<Layer> iconLayer;
71 std::unique_ptr<Layer> osdGuiLayer;
72};
73
74} // namespace openmsx
75
76#endif
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
Class containing all settings for renderers.
bool getCursorEnabled() override
SDLVideoSystem(Reactor &reactor, CommandConsole &console)
Activates this video system.
void repaint() override
Requests a repaint of the output surface.
void setClipboardText(zstring_view text) override
void showCursor(bool show) override
gl::ivec2 getMouseCoord() override
Returns the current mouse pointer coordinates.
std::unique_ptr< V9990Rasterizer > createV9990Rasterizer(V9990 &vdp) override
Create the V9990 rasterizer selected by the current renderer setting.
~SDLVideoSystem() override
Deactivates this video system.
bool checkSettings() override
Requests that this renderer checks its settings against the current RenderSettings.
OutputSurface * getOutputSurface() override
TODO.
void takeScreenShot(const std::string &filename, bool withOsd) override
Take a screenshot.
std::unique_ptr< LDRasterizer > createLDRasterizer(LaserdiscPlayer &ld) override
void updateWindowTitle() override
Called when the window title string has changed.
std::string getClipboardText() override
void flush() override
Finish pending drawing operations and make them visible to the user.
std::unique_ptr< Rasterizer > createRasterizer(VDP &vdp) override
Create the rasterizer selected by the current renderer setting.
Implementation of the Yamaha V9990 VDP as used in the GFX9000 cartridge by Sunrise.
Definition: V9990.hh:34
Unified implementation of MSX Video Display Processors (VDPs).
Definition: VDP.hh:64
Video back-end system.
Definition: VideoSystem.hh:23
Like std::string_view, but with the extra guarantee that it refers to a zero-terminated string.
Definition: zstring_view.hh:22
This file implemented 3 utility functions:
Definition: Autofire.cc:9