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));
186 gl::ivec2 SDLVideoSystem::getWindowSize()
192 if (factor > 3) factor = 3;
200 return {320 * factor, 240 * factor};
208 if (getWindowSize() != screen->getLogicalSize()) {
213 return screen->setFullScreen(renderSettings.
getFullScreen());
231 std::unique_ptr<OutputSurface> surf = screen->createOffScreenSurface();
239 screen->updateWindowTitle();
249 SDL_ShowCursor(show ? SDL_ENABLE : SDL_DISABLE);
257 void SDLVideoSystem::resize()
263 auto [width, height] = getWindowSize();
269 screen = std::make_unique<SDLVisibleSurface>(
270 width, height, display, rtScheduler,
271 eventDistributor, inputEventGenerator,
276 screen = std::make_unique<SDLGLVisibleSurface>(
277 width, height, display, rtScheduler,
278 eventDistributor, inputEventGenerator,
287 void SDLVideoSystem::update(
const Setting& subject)
298 int SDLVideoSystem::signalEvent(
const std::shared_ptr<const Event>& )
void repaint()
Redraw the display.
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 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.
EventDistributor & getEventDistributor()
RTScheduler & getRTScheduler()
InputEventGenerator & getInputEventGenerator()
RendererID getRenderer() const
int getScaleFactor() const
bool getFullScreen() const
IntegerSetting & getScaleFactorSetting()
The current scaling factor.
SDLVideoSystem(Reactor &reactor, CommandConsole &console)
Activates this video system.
void showCursor(bool show) override
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.
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).
This file implemented 3 utility functions:
constexpr const char *const filename