18#if COMPONENT_LASERDISC
27 , display(reactor.getDisplay())
28 , renderSettings(reactor.getDisplay().getRenderSettings())
30 screen = std::make_unique<VisibleSurface>(
36 snowLayer = screen->createSnowLayer();
37 osdGuiLayer = screen->createOSDGUILayer(display.
getOSDGUI());
60 std::string videoSource = (vdp.
getName() ==
"VDP")
64 return std::make_unique<SDLRasterizer>(
65 vdp, display, *screen,
66 std::make_unique<PostProcessor>(
67 motherBoard, display, *screen,
68 videoSource, 640, 240,
true));
75 std::string videoSource = (vdp.
getName() ==
"Sunrise GFX9000")
79 return std::make_unique<V9990SDLRasterizer>(
80 vdp, display, *screen,
81 std::make_unique<PostProcessor>(
82 motherBoard, display, *screen,
83 videoSource, 1280, 240,
true));
86#if COMPONENT_LASERDISC
87std::unique_ptr<LDRasterizer> SDLVideoSystem::createLDRasterizer(
91 std::string videoSource =
"Laserdisc";
93 return std::make_unique<LDSDLRasterizer>(
94 std::make_unique<PostProcessor>(
95 motherBoard, display, *screen,
96 videoSource, 640, 480,
false));
109 screen->saveScreenshot(filename);
115 std::unique_ptr<OutputSurface> surf = screen->createOffScreenSurface();
117 surf->saveScreenshot(filename);
123 screen->updateWindowTitle();
129 SDL_GetMouseState(&mouseX, &mouseY);
130 return {mouseX, mouseY};
140 SDL_ShowCursor(show ? SDL_ENABLE : SDL_DISABLE);
142 ImGui::GetIO().ConfigFlags &= ~ImGuiConfigFlags_NoMouseCursorChange;
144 ImGui::GetIO().ConfigFlags |= ImGuiConfigFlags_NoMouseCursorChange;
150 return SDL_ShowCursor(SDL_QUERY) == SDL_ENABLE;
156 if (
char* text = SDL_GetClipboardText()) {
165 if (SDL_SetClipboardText(text.
c_str()) != 0) {
166 const char* err = SDL_GetError();
174 return screen->getWindowPosition();
179 screen->setWindowPosition(pos);
188void SDLVideoSystem::update(
const Setting& subject)
noexcept
190 if (&subject == &renderSettings.getFullScreenSetting()) {
191 screen->setFullScreen(renderSettings.getFullScreen());
192 }
else if (&subject == &renderSettings.getScaleFactorSetting()) {
199bool SDLVideoSystem::signalEvent(
const Event& )
void removeLayer(Layer &layer)
void addLayer(Layer &layer)
MSXMotherBoard & getMotherBoard()
MSXMotherBoard & getMotherBoard() const
Get the mother board this device belongs to.
virtual const std::string & getName() const
Returns a human-readable name for this device.
A frame buffer where pixels can be written to.
Contains the main loop of openMSX.
ImGuiManager & getImGuiManager()
RTScheduler & getRTScheduler()
EventDistributor & getEventDistributor()
InputEventGenerator & getInputEventGenerator()
BooleanSetting & getFullScreenSetting()
Full screen [on, off].
IntegerSetting & getScaleFactorSetting()
The current scaling factor.
RendererID getRenderer() const
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
SDLVideoSystem(Reactor &reactor)
Activates this video system.
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.
void detach(Observer< T > &observer)
void attach(Observer< T > &observer)
Implementation of the Yamaha V9990 VDP as used in the GFX9000 cartridge by Sunrise.
Unified implementation of MSX Video Display Processors (VDPs).
Like std::string_view, but with the extra guarantee that it refers to a zero-terminated string.
constexpr const char * c_str() const
This file implemented 3 utility functions:
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