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 "Observer.hh"
7#include "gl_vec.hh"
8#include "components.hh"
9#include <memory>
10
11namespace openmsx {
12
13class Display;
14class Layer;
15class Reactor;
16class RenderSettings;
17class Setting;
18class VisibleSurface;
19
20class SDLVideoSystem final : public VideoSystem, private EventListener
21 , private Observer<Setting>
22{
23public:
27 explicit SDLVideoSystem(Reactor& reactor);
28
31 ~SDLVideoSystem() override;
32
33 // VideoSystem interface:
34 [[nodiscard]] std::unique_ptr<Rasterizer> createRasterizer(VDP& vdp) override;
35 [[nodiscard]] std::unique_ptr<V9990Rasterizer> createV9990Rasterizer(
36 V9990& vdp) override;
37#if COMPONENT_LASERDISC
38 std::unique_ptr<LDRasterizer> createLDRasterizer(
39 LaserdiscPlayer& ld) override;
40#endif
41 void flush() override;
42 void takeScreenShot(const std::string& filename, bool withOsd) override;
43 void updateWindowTitle() override;
44 [[nodiscard]] gl::ivec2 getMouseCoord() override;
45 [[nodiscard]] OutputSurface* getOutputSurface() override;
46 void showCursor(bool show) override;
47 [[nodiscard]] bool getCursorEnabled() override;
48 [[nodiscard]] std::string getClipboardText() override;
49 void setClipboardText(zstring_view text) override;
50 [[nodiscard]] std::optional<gl::ivec2> getWindowPosition() override;
51 void setWindowPosition(gl::ivec2 pos) override;
52 void repaint() override;
53
54private:
55 // EventListener
56 bool signalEvent(const Event& event) override;
57 // Observer
58 void update(const Setting& subject) noexcept override;
59
60private:
61 Reactor& reactor;
62 Display& display;
63 RenderSettings& renderSettings;
64 std::unique_ptr<VisibleSurface> screen;
65 std::unique_ptr<Layer> snowLayer;
66 std::unique_ptr<Layer> iconLayer;
67 std::unique_ptr<Layer> osdGuiLayer;
68 std::unique_ptr<Layer> imGuiLayer;
69};
70
71} // namespace openmsx
72
73#endif
Represents the output window/screen of openMSX.
Definition Display.hh:31
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:75
Class containing all settings for renderers.
bool getCursorEnabled() override
void setWindowPosition(gl::ivec2 pos) override
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.
OutputSurface * getOutputSurface() override
TODO.
std::optional< gl::ivec2 > getWindowPosition() override
void takeScreenShot(const std::string &filename, bool withOsd) override
Take a screenshot.
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:35
Unified implementation of MSX Video Display Processors (VDPs).
Definition VDP.hh:67
Video back-end system.
Like std::string_view, but with the extra guarantee that it refers to a zero-terminated string.
This file implemented 3 utility functions:
Definition Autofire.cc:11
std::variant< KeyUpEvent, KeyDownEvent, MouseMotionEvent, MouseButtonUpEvent, MouseButtonDownEvent, MouseWheelEvent, JoystickAxisMotionEvent, JoystickHatEvent, JoystickButtonUpEvent, JoystickButtonDownEvent, OsdControlReleaseEvent, OsdControlPressEvent, WindowEvent, TextEvent, FileDropEvent, QuitEvent, FinishFrameEvent, CliCommandEvent, GroupEvent, BootEvent, FrameDrawnEvent, BreakEvent, SwitchRendererEvent, TakeReverseSnapshotEvent, AfterTimedEvent, MachineLoadedEvent, MachineActivatedEvent, MachineDeactivatedEvent, MidiInReaderEvent, MidiInWindowsEvent, MidiInCoreMidiEvent, MidiInCoreMidiVirtualEvent, MidiInALSAEvent, Rs232TesterEvent, Rs232NetEvent, ImGuiDelayedActionEvent, ImGuiActiveEvent > Event
Definition Event.hh:445