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 void repaint() override;
51
52private:
53 // EventListener
54 int signalEvent(const Event& event) override;
55 // Observer
56 void update(const Setting& subject) noexcept override;
57
58private:
59 Reactor& reactor;
60 Display& display;
61 RenderSettings& renderSettings;
62 std::unique_ptr<VisibleSurface> screen;
63 std::unique_ptr<Layer> snowLayer;
64 std::unique_ptr<Layer> iconLayer;
65 std::unique_ptr<Layer> osdGuiLayer;
66 std::unique_ptr<Layer> imGuiLayer;
67};
68
69} // namespace openmsx
70
71#endif
Represents the output window/screen of openMSX.
Definition: Display.hh:32
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:72
Class containing all settings for renderers.
bool getCursorEnabled() 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.
SDLVideoSystem(Reactor &reactor)
Activates this video system.
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:35
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
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, ImGuiDelayedActionEvent, ImGuiActiveEvent > Event
Definition: Event.hh:450