22#if COMPONENT_LASERDISC
31 , display(reactor.getDisplay())
32 , renderSettings(reactor.getDisplay().getRenderSettings())
36 consoleLayer = screen->createConsoleLayer(reactor, console);
37 snowLayer = screen->createSnowLayer();
38 osdGuiLayer = screen->createOSDGUILayer(display.
getOSDGUI());
63 std::string videoSource = (vdp.
getName() ==
"VDP")
69 switch (screen->getPixelFormat().getBytesPerPixel()) {
72 return std::make_unique<SDLRasterizer<uint16_t>>(
73 vdp, display, *screen,
74 std::make_unique<FBPostProcessor<uint16_t>>(
75 motherBoard, display, *screen,
76 videoSource, 640, 240,
true));
80 return std::make_unique<SDLRasterizer<uint32_t>>(
81 vdp, display, *screen,
82 std::make_unique<FBPostProcessor<uint32_t>>(
83 motherBoard, display, *screen,
84 videoSource, 640, 240,
true));
91 return std::make_unique<SDLRasterizer<uint32_t>>(
92 vdp, display, *screen,
93 std::make_unique<GLPostProcessor>(
94 motherBoard, display, *screen,
95 videoSource, 640, 240,
true));
105 std::string videoSource = (vdp.
getName() ==
"Sunrise GFX9000")
111 switch (screen->getPixelFormat().getBytesPerPixel()) {
114 return std::make_unique<V9990SDLRasterizer<uint16_t>>(
115 vdp, display, *screen,
116 std::make_unique<FBPostProcessor<uint16_t>>(
117 motherBoard, display, *screen,
118 videoSource, 1280, 240,
true));
122 return std::make_unique<V9990SDLRasterizer<uint32_t>>(
123 vdp, display, *screen,
124 std::make_unique<FBPostProcessor<uint32_t>>(
125 motherBoard, display, *screen,
126 videoSource, 1280, 240,
true));
133 return std::make_unique<V9990SDLRasterizer<uint32_t>>(
134 vdp, display, *screen,
135 std::make_unique<GLPostProcessor>(
136 motherBoard, display, *screen,
137 videoSource, 1280, 240,
true));
144#if COMPONENT_LASERDISC
148 std::string videoSource =
"Laserdisc";
152 switch (screen->getPixelFormat().getBytesPerPixel()) {
155 return std::make_unique<LDSDLRasterizer<uint16_t>>(
157 std::make_unique<FBPostProcessor<uint16_t>>(
158 motherBoard, display, *screen,
159 videoSource, 640, 480,
false));
163 return std::make_unique<LDSDLRasterizer<uint32_t>>(
165 std::make_unique<FBPostProcessor<uint32_t>>(
166 motherBoard, display, *screen,
167 videoSource, 640, 480,
false));
174 return std::make_unique<LDSDLRasterizer<uint32_t>>(
176 std::make_unique<GLPostProcessor>(
177 motherBoard, display, *screen,
178 videoSource, 640, 480,
false));
192 if (factor > 3) factor = 3;
200 return {320 * factor, 240 * factor};
208 if (getWindowSize() != screen->getLogicalSize()) {
213 return screen->setFullScreen(renderSettings.
getFullScreen());
225 screen->saveScreenshot(filename);
231 std::unique_ptr<OutputSurface> surf = screen->createOffScreenSurface();
233 surf->saveScreenshot(filename);
239 screen->updateWindowTitle();
245 SDL_GetMouseState(&mouseX, &mouseY);
246 return {mouseX, mouseY};
256 SDL_ShowCursor(show ? SDL_ENABLE : SDL_DISABLE);
261 return SDL_ShowCursor(SDL_QUERY) == SDL_ENABLE;
267 if (
char* text = SDL_GetClipboardText()) {
276 if (SDL_SetClipboardText(text.
c_str()) != 0) {
277 const char* err = SDL_GetError();
289void SDLVideoSystem::resize()
295 auto [width, height] = getWindowSize();
301 screen = std::make_unique<SDLVisibleSurface>(
302 width, height, display, rtScheduler,
303 eventDistributor, inputEventGenerator,
308 screen = std::make_unique<SDLGLVisibleSurface>(
309 width, height, display, rtScheduler,
310 eventDistributor, inputEventGenerator,
319void SDLVideoSystem::update(
const Setting& subject)
noexcept
321 if (&subject == &renderSettings.getScaleFactorSetting()) {
330int SDLVideoSystem::signalEvent(
const Event& )
void removeLayer(Layer &layer)
void addLayer(Layer &layer)
void unregisterEventListener(EventType type, EventListener &listener)
Unregisters a previously registered event listener.
void registerEventListener(EventType type, EventListener &listener, Priority priority=OTHER)
Registers a given object to receive certain events.
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.
RTScheduler & getRTScheduler()
EventDistributor & getEventDistributor()
InputEventGenerator & getInputEventGenerator()
IntegerSetting & getScaleFactorSetting()
The current scaling factor.
RendererID getRenderer() const
int getScaleFactor() const
bool getFullScreen() const
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.
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: