Update to 20180731 release.

byuu says:

I've completed moving all the class objects from `unique_pointer<T>` to
just T. The one exception is the Emulator::Interface instance. I can
absolutely make that a global object, but only in bsnes where there's
just the one emulation core.

I also moved all the SettingsWindow and ToolsWindow panels out to their
own global objects, and fixed a very difficult bug with GTK TabFrame
controls.

The configuration settings panel is now the emulator settings panel. And
I added some spacing between bold label sections on both the emulator
and driver settings panels.

I gave fixing ComboButtonItem my best shot, given I can't reproduce the
crash. Probably won't work, though.

Also made a very slight consistency improvement to ruby and renamed
driverName() to driver().

...

An important change ... as a result of moving bsnes to global objects,
this means that the constructors for all windows run before the
presentation window is displayed. Before this change, only the
presentation window was constructed first berore displaying it, followed
by the construction of the rest of the GUI windows.

The upside to this is that as soon as you see the main window, the GUI
is ready to go without a period where it's unresponsive.

The downside to this is it takes about 1.5 seconds to show the main
window, compared to around 0.75 seconds before.

I've no intention of changing that back. So if the startup time becomes
a problem, then we'll just have to work on optimizing hiro, so that it
can construct all the global Window objects quicker. The main way to do
that would be to not do calls to the Layout::setGeometry functions for
every widget added, and instead wait until the window is displayed. But
I don't have an easy way to do that, because you want the widget
geometry values to be sane even before the window is visible to help
size certain things.
This commit is contained in:
Tim Allen
2018-07-31 20:56:45 +10:00
parent 212da0a966
commit 2335bb0df8
57 changed files with 557 additions and 560 deletions

View File

@@ -41,144 +41,144 @@
namespace ruby {
auto Audio::setExclusive(bool exclusive) -> bool {
if(driver->exclusive == exclusive) return true;
if(!driver->hasExclusive()) return false;
if(!driver->setExclusive(driver->exclusive = exclusive)) return false;
if(instance->exclusive == exclusive) return true;
if(!instance->hasExclusive()) return false;
if(!instance->setExclusive(instance->exclusive = exclusive)) return false;
return true;
}
auto Audio::setContext(uintptr context) -> bool {
if(driver->context == context) return true;
if(!driver->hasContext()) return false;
if(!driver->setContext(driver->context = context)) return false;
if(instance->context == context) return true;
if(!instance->hasContext()) return false;
if(!instance->setContext(instance->context = context)) return false;
return true;
}
auto Audio::setDevice(string device) -> bool {
if(driver->device == device) return true;
if(!driver->hasDevice(device)) return false;
if(!driver->setDevice(driver->device = device)) return false;
if(instance->device == device) return true;
if(!instance->hasDevice(device)) return false;
if(!instance->setDevice(instance->device = device)) return false;
return true;
}
auto Audio::setBlocking(bool blocking) -> bool {
if(driver->blocking == blocking) return true;
if(!driver->hasBlocking()) return false;
if(!driver->setBlocking(driver->blocking = blocking)) return false;
for(auto& resampler : resamplers) resampler.reset(driver->frequency);
if(instance->blocking == blocking) return true;
if(!instance->hasBlocking()) return false;
if(!instance->setBlocking(instance->blocking = blocking)) return false;
for(auto& resampler : resamplers) resampler.reset(instance->frequency);
return true;
}
auto Audio::setDynamic(bool dynamic) -> bool {
if(driver->dynamic == dynamic) return true;
if(!driver->hasDynamic()) return false;
if(!driver->setDynamic(driver->dynamic = dynamic)) return false;
if(instance->dynamic == dynamic) return true;
if(!instance->hasDynamic()) return false;
if(!instance->setDynamic(instance->dynamic = dynamic)) return false;
return true;
}
auto Audio::setChannels(uint channels) -> bool {
if(driver->channels == channels) return true;
if(!driver->hasChannels(channels)) return false;
if(!driver->setChannels(driver->channels = channels)) return false;
if(instance->channels == channels) return true;
if(!instance->hasChannels(channels)) return false;
if(!instance->setChannels(instance->channels = channels)) return false;
resamplers.reset();
resamplers.resize(channels);
for(auto& resampler : resamplers) resampler.reset(driver->frequency);
for(auto& resampler : resamplers) resampler.reset(instance->frequency);
return true;
}
auto Audio::setFrequency(uint frequency) -> bool {
if(driver->frequency == frequency) return true;
if(!driver->hasFrequency(frequency)) return false;
if(!driver->setFrequency(driver->frequency = frequency)) return false;
for(auto& resampler : resamplers) resampler.reset(driver->frequency);
if(instance->frequency == frequency) return true;
if(!instance->hasFrequency(frequency)) return false;
if(!instance->setFrequency(instance->frequency = frequency)) return false;
for(auto& resampler : resamplers) resampler.reset(instance->frequency);
return true;
}
auto Audio::setLatency(uint latency) -> bool {
if(driver->latency == latency) return true;
if(!driver->hasLatency(latency)) return false;
if(!driver->setLatency(driver->latency = latency)) return false;
if(instance->latency == latency) return true;
if(!instance->hasLatency(latency)) return false;
if(!instance->setLatency(instance->latency = latency)) return false;
return true;
}
//
auto Audio::clear() -> void {
for(auto& resampler : resamplers) resampler.reset(driver->frequency);
return driver->clear();
for(auto& resampler : resamplers) resampler.reset(instance->frequency);
return instance->clear();
}
auto Audio::level() -> double {
return driver->level();
return instance->level();
}
auto Audio::output(const double samples[]) -> void {
if(!driver->dynamic) return driver->output(samples);
if(!instance->dynamic) return instance->output(samples);
auto maxDelta = 0.005;
double fillLevel = driver->level();
double dynamicFrequency = ((1.0 - maxDelta) + 2.0 * fillLevel * maxDelta) * driver->frequency;
double fillLevel = instance->level();
double dynamicFrequency = ((1.0 - maxDelta) + 2.0 * fillLevel * maxDelta) * instance->frequency;
for(auto& resampler : resamplers) {
resampler.setInputFrequency(dynamicFrequency);
resampler.write(*samples++);
}
while(resamplers.first().pending()) {
double samples[driver->channels];
for(uint n : range(driver->channels)) samples[n] = resamplers[n].read();
driver->output(samples);
double samples[instance->channels];
for(uint n : range(instance->channels)) samples[n] = resamplers[n].read();
instance->output(samples);
}
}
//
auto Audio::create(string driver) -> bool {
reset();
self.instance.reset();
if(!driver) driver = optimalDriver();
#if defined(AUDIO_ALSA)
if(driver == "ALSA") self.driver = new AudioALSA(*this);
if(driver == "ALSA") self.instance = new AudioALSA(*this);
#endif
#if defined(AUDIO_AO)
if(driver == "libao") self.driver = new AudioAO(*this);
if(driver == "libao") self.instance = new AudioAO(*this);
#endif
#if defined(AUDIO_ASIO)
if(driver == "ASIO") self.driver = new AudioASIO(*this);
if(driver == "ASIO") self.instance = new AudioASIO(*this);
#endif
#if defined(AUDIO_DIRECTSOUND)
if(driver == "DirectSound") self.driver = new AudioDirectSound(*this);
if(driver == "DirectSound") self.instance = new AudioDirectSound(*this);
#endif
#if defined(AUDIO_OPENAL)
if(driver == "OpenAL") self.driver = new AudioOpenAL(*this);
if(driver == "OpenAL") self.instance = new AudioOpenAL(*this);
#endif
#if defined(AUDIO_OSS)
if(driver == "OSS") self.driver = new AudioOSS(*this);
if(driver == "OSS") self.instance = new AudioOSS(*this);
#endif
#if defined(AUDIO_PULSEAUDIO)
if(driver == "PulseAudio") self.driver = new AudioPulseAudio(*this);
if(driver == "PulseAudio") self.instance = new AudioPulseAudio(*this);
#endif
#if defined(AUDIO_PULSEAUDIOSIMPLE)
if(driver == "PulseAudioSimple") self.driver = new AudioPulseAudioSimple(*this);
if(driver == "PulseAudioSimple") self.instance = new AudioPulseAudioSimple(*this);
#endif
#if defined(AUDIO_WASAPI)
if(driver == "WASAPI") self.driver = new AudioWASAPI(*this);
if(driver == "WASAPI") self.instance = new AudioWASAPI(*this);
#endif
#if defined(AUDIO_XAUDIO2)
if(driver == "XAudio2") self.driver = new AudioXAudio2(*this);
if(driver == "XAudio2") self.instance = new AudioXAudio2(*this);
#endif
if(!self.driver) self.driver = new AudioDriver(*this);
if(!self.instance) self.instance = new AudioDriver(*this);
return self.driver->create();
return self.instance->create();
}
auto Audio::hasDrivers() -> vector<string> {

View File

@@ -5,7 +5,7 @@ struct AudioDriver {
virtual ~AudioDriver() = default;
virtual auto create() -> bool { return true; }
virtual auto driverName() -> string { return "None"; }
virtual auto driver() -> string { return "None"; }
virtual auto ready() -> bool { return true; }
virtual auto hasExclusive() -> bool { return false; }
@@ -55,35 +55,35 @@ struct Audio {
static auto optimalDriver() -> string;
static auto safestDriver() -> string;
Audio() : self(*this) {}
explicit operator bool() const { return (bool)driver; }
auto reset() -> void { driver.reset(); }
Audio() : self(*this) { reset(); }
explicit operator bool() { return instance->driver() != "None"; }
auto reset() -> void { instance = new AudioDriver(*this); }
auto create(string driver = "") -> bool;
auto driverName() -> string { return driver->driverName(); }
auto ready() -> bool { return driver->ready(); }
auto driver() -> string { return instance->driver(); }
auto ready() -> bool { return instance->ready(); }
auto hasExclusive() -> bool { return driver->hasExclusive(); }
auto hasContext() -> bool { return driver->hasContext(); }
auto hasDevices() -> vector<string> { return driver->hasDevices(); }
auto hasBlocking() -> bool { return driver->hasBlocking(); }
auto hasDynamic() -> bool { return driver->hasDynamic(); }
auto hasChannels() -> vector<uint> { return driver->hasChannels(); }
auto hasFrequencies() -> vector<uint> { return driver->hasFrequencies(); }
auto hasLatencies() -> vector<uint> { return driver->hasLatencies(); }
auto hasExclusive() -> bool { return instance->hasExclusive(); }
auto hasContext() -> bool { return instance->hasContext(); }
auto hasDevices() -> vector<string> { return instance->hasDevices(); }
auto hasBlocking() -> bool { return instance->hasBlocking(); }
auto hasDynamic() -> bool { return instance->hasDynamic(); }
auto hasChannels() -> vector<uint> { return instance->hasChannels(); }
auto hasFrequencies() -> vector<uint> { return instance->hasFrequencies(); }
auto hasLatencies() -> vector<uint> { return instance->hasLatencies(); }
auto hasDevice(string device) -> bool { return driver->hasDevice(device); }
auto hasChannels(uint channels) -> bool { return driver->hasChannels(channels); }
auto hasFrequency(uint frequency) -> bool { return driver->hasFrequency(frequency); }
auto hasLatency(uint latency) -> bool { return driver->hasLatency(latency); }
auto hasDevice(string device) -> bool { return instance->hasDevice(device); }
auto hasChannels(uint channels) -> bool { return instance->hasChannels(channels); }
auto hasFrequency(uint frequency) -> bool { return instance->hasFrequency(frequency); }
auto hasLatency(uint latency) -> bool { return instance->hasLatency(latency); }
auto exclusive() -> bool { return driver->exclusive; }
auto context() -> uintptr { return driver->context; }
auto device() -> string { return driver->device; }
auto blocking() -> bool { return driver->blocking; }
auto dynamic() -> bool { return driver->dynamic; }
auto channels() -> uint { return driver->channels; }
auto frequency() -> uint { return driver->frequency; }
auto latency() -> uint { return driver->latency; }
auto exclusive() -> bool { return instance->exclusive; }
auto context() -> uintptr { return instance->context; }
auto device() -> string { return instance->device; }
auto blocking() -> bool { return instance->blocking; }
auto dynamic() -> bool { return instance->dynamic; }
auto channels() -> uint { return instance->channels; }
auto frequency() -> uint { return instance->frequency; }
auto latency() -> uint { return instance->latency; }
auto setExclusive(bool exclusive) -> bool;
auto setContext(uintptr context) -> bool;
@@ -100,6 +100,6 @@ struct Audio {
protected:
Audio& self;
unique_pointer<AudioDriver> driver;
unique_pointer<AudioDriver> instance;
vector<nall::DSP::Resampler::Cubic> resamplers;
};

View File

@@ -28,7 +28,7 @@ struct AudioOSS : AudioDriver {
return initialize();
}
auto driverName() -> string override { return "OSS"; }
auto driver() -> string override { return "OSS"; }
auto ready() -> bool override { return _fd >= 0; }
auto hasBlocking() -> bool override { return true; }

View File

@@ -25,32 +25,32 @@
namespace ruby {
auto Input::setContext(uintptr context) -> bool {
if(driver->context == context) return true;
if(!driver->hasContext()) return false;
if(!driver->setContext(driver->context = context)) return false;
if(instance->context == context) return true;
if(!instance->hasContext()) return false;
if(!instance->setContext(instance->context = context)) return false;
return true;
}
//
auto Input::acquired() -> bool {
return driver->acquired();
return instance->acquired();
}
auto Input::acquire() -> bool {
return driver->acquire();
return instance->acquire();
}
auto Input::release() -> bool {
return driver->release();
return instance->release();
}
auto Input::poll() -> vector<shared_pointer<nall::HID::Device>> {
return driver->poll();
return instance->poll();
}
auto Input::rumble(uint64_t id, bool enable) -> bool {
return driver->rumble(id, enable);
return instance->rumble(id, enable);
}
//
@@ -66,36 +66,36 @@ auto Input::doChange(shared_pointer<HID::Device> device, uint group, uint input,
//
auto Input::create(string driver) -> bool {
reset();
self.instance.reset();
if(!driver) driver = optimalDriver();
#if defined(INPUT_WINDOWS)
if(driver == "Windows") self.driver = new InputWindows(*this);
if(driver == "Windows") self.instance = new InputWindows(*this);
#endif
#if defined(INPUT_QUARTZ)
if(driver == "Quartz") self.driver = new InputQuartz(*this);
if(driver == "Quartz") self.instance = new InputQuartz(*this);
#endif
#if defined(INPUT_CARBON)
if(driver == "Carbon") self.driver = new InputCarbon(*this);
if(driver == "Carbon") self.instance = new InputCarbon(*this);
#endif
#if defined(INPUT_UDEV)
if(driver == "udev") self.driver = new InputUdev(*this);
if(driver == "udev") self.instance = new InputUdev(*this);
#endif
#if defined(INPUT_SDL)
if(driver == "SDL") self.driver = new InputSDL(*this);
if(driver == "SDL") self.instance = new InputSDL(*this);
#endif
#if defined(INPUT_XLIB)
if(driver == "Xlib") self.driver = new InputXlib(*this);
if(driver == "Xlib") self.instance = new InputXlib(*this);
#endif
if(!self.driver) self.driver = new InputDriver(*this);
if(!self.instance) self.instance = new InputDriver(*this);
return self.driver->create();
return self.instance->create();
}
auto Input::hasDrivers() -> vector<string> {

View File

@@ -5,7 +5,7 @@ struct InputDriver {
virtual ~InputDriver() = default;
virtual auto create() -> bool { return true; }
virtual auto driverName() -> string { return "None"; }
virtual auto driver() -> string { return "None"; }
virtual auto ready() -> bool { return true; }
virtual auto hasContext() -> bool { return false; }
@@ -31,16 +31,16 @@ struct Input {
static auto optimalDriver() -> string;
static auto safestDriver() -> string;
Input() : self(*this) {}
explicit operator bool() const { return (bool)driver; }
auto reset() -> void { driver.reset(); }
Input() : self(*this) { reset(); }
explicit operator bool() { return instance->driver() != "None"; }
auto reset() -> void { instance = new InputDriver(*this); }
auto create(string driver = "") -> bool;
auto driverName() -> string { return driver->driverName(); }
auto ready() -> bool { return driver->ready(); }
auto driver() -> string { return instance->driver(); }
auto ready() -> bool { return instance->ready(); }
auto hasContext() -> bool { return driver->hasContext(); }
auto hasContext() -> bool { return instance->hasContext(); }
auto context() -> uintptr { return driver->context; }
auto context() -> uintptr { return instance->context; }
auto setContext(uintptr context) -> bool;
@@ -55,6 +55,6 @@ struct Input {
protected:
Input& self;
unique_pointer<InputDriver> driver;
unique_pointer<InputDriver> instance;
function<void (shared_pointer<nall::HID::Device> device, uint group, uint input, int16_t oldValue, int16_t newValue)> change;
};

View File

@@ -16,7 +16,7 @@ struct InputSDL : InputDriver {
return initialize();
}
auto driverName() -> string override { return "SDL"; }
auto driver() -> string override { return "SDL"; }
auto ready() -> bool override { return isReady; }
auto hasContext() -> bool override { return true; }

View File

@@ -32,7 +32,7 @@ struct VideoGLX2 : VideoDriver {
return initialize();
}
auto driverName() -> string override { return "OpenGL2"; }
auto driver() -> string override { return "OpenGL2"; }
auto ready() -> bool override { return _ready; }
auto hasContext() -> bool override { return true; }

View File

@@ -37,74 +37,74 @@
namespace ruby {
auto Video::setExclusive(bool exclusive) -> bool {
if(driver->exclusive == exclusive) return true;
if(!driver->hasExclusive()) return false;
if(!driver->setExclusive(driver->exclusive = exclusive)) return false;
if(instance->exclusive == exclusive) return true;
if(!instance->hasExclusive()) return false;
if(!instance->setExclusive(instance->exclusive = exclusive)) return false;
return true;
}
auto Video::setContext(uintptr context) -> bool {
if(driver->context == context) return true;
if(!driver->hasContext()) return false;
if(!driver->setContext(driver->context = context)) return false;
if(instance->context == context) return true;
if(!instance->hasContext()) return false;
if(!instance->setContext(instance->context = context)) return false;
return true;
}
auto Video::setBlocking(bool blocking) -> bool {
if(driver->blocking == blocking) return true;
if(!driver->hasBlocking()) return false;
if(!driver->setBlocking(driver->blocking = blocking)) return false;
if(instance->blocking == blocking) return true;
if(!instance->hasBlocking()) return false;
if(!instance->setBlocking(instance->blocking = blocking)) return false;
return true;
}
auto Video::setFlush(bool flush) -> bool {
if(driver->flush == flush) return true;
if(!driver->hasFlush()) return false;
if(!driver->setFlush(driver->flush = flush)) return false;
if(instance->flush == flush) return true;
if(!instance->hasFlush()) return false;
if(!instance->setFlush(instance->flush = flush)) return false;
return true;
}
auto Video::setFormat(string format) -> bool {
if(driver->format == format) return true;
if(!driver->hasFormat(format)) return false;
if(!driver->setFormat(driver->format = format)) return false;
if(instance->format == format) return true;
if(!instance->hasFormat(format)) return false;
if(!instance->setFormat(instance->format = format)) return false;
return true;
}
auto Video::setSmooth(bool smooth) -> bool {
if(driver->smooth == smooth) return true;
if(!driver->hasSmooth()) return false;
if(!driver->setSmooth(driver->smooth = smooth)) return false;
if(instance->smooth == smooth) return true;
if(!instance->hasSmooth()) return false;
if(!instance->setSmooth(instance->smooth = smooth)) return false;
return true;
}
auto Video::setShader(string shader) -> bool {
if(driver->shader == shader) return true;
if(!driver->hasShader()) return false;
if(!driver->setShader(driver->shader = shader)) return false;
if(instance->shader == shader) return true;
if(!instance->hasShader()) return false;
if(!instance->setShader(instance->shader = shader)) return false;
return true;
}
//
auto Video::clear() -> void {
return driver->clear();
return instance->clear();
}
auto Video::acquire(uint32_t*& data, uint& pitch, uint width, uint height) -> bool {
return driver->acquire(data, pitch, width, height);
return instance->acquire(data, pitch, width, height);
}
auto Video::release() -> void {
return driver->release();
return instance->release();
}
auto Video::output() -> void {
return driver->output();
return instance->output();
}
auto Video::poll() -> void {
return driver->poll();
return instance->poll();
}
//
@@ -120,48 +120,48 @@ auto Video::doUpdate(uint width, uint height) -> void {
//
auto Video::create(string driver) -> bool {
reset();
self.instance.reset();
if(!driver) driver = optimalDriver();
#if defined(VIDEO_CGL)
if(driver == "OpenGL") self.driver = new VideoCGL(*this);
if(driver == "OpenGL") self.instance = new VideoCGL(*this);
#endif
#if defined(VIDEO_DIRECT3D)
if(driver == "Direct3D") self.driver = new VideoDirect3D(*this);
if(driver == "Direct3D") self.instance = new VideoDirect3D(*this);
#endif
#if defined(VIDEO_DIRECTDRAW)
if(driver == "DirectDraw") self.driver = new VideoDirectDraw(*this);
if(driver == "DirectDraw") self.instance = new VideoDirectDraw(*this);
#endif
#if defined(VIDEO_GDI)
if(driver == "GDI") self.driver = new VideoGDI(*this);
if(driver == "GDI") self.instance = new VideoGDI(*this);
#endif
#if defined(VIDEO_GLX)
if(driver == "OpenGL") self.driver = new VideoGLX(*this);
if(driver == "OpenGL") self.instance = new VideoGLX(*this);
#endif
#if defined(VIDEO_GLX2)
if(driver == "OpenGL2") self.driver = new VideoGLX2(*this);
if(driver == "OpenGL2") self.instance = new VideoGLX2(*this);
#endif
#if defined(VIDEO_WGL)
if(driver == "OpenGL") self.driver = new VideoWGL(*this);
if(driver == "OpenGL") self.instance = new VideoWGL(*this);
#endif
#if defined(VIDEO_XSHM)
if(driver == "XShm") self.driver = new VideoXShm(*this);
if(driver == "XShm") self.instance = new VideoXShm(*this);
#endif
#if defined(VIDEO_XVIDEO)
if(driver == "XVideo") self.driver = new VideoXVideo(*this);
if(driver == "XVideo") self.instance = new VideoXVideo(*this);
#endif
if(!self.driver) self.driver = new VideoDriver(*this);
if(!self.instance) self.instance = new VideoDriver(*this);
return self.driver->create();
return self.instance->create();
}
auto Video::hasDrivers() -> vector<string> {

View File

@@ -5,7 +5,7 @@ struct VideoDriver {
virtual ~VideoDriver() = default;
virtual auto create() -> bool { return true; }
virtual auto driverName() -> string { return "None"; }
virtual auto driver() -> string { return "None"; }
virtual auto ready() -> bool { return true; }
virtual auto hasExclusive() -> bool { return false; }
@@ -51,30 +51,30 @@ struct Video {
static auto optimalDriver() -> string;
static auto safestDriver() -> string;
Video() : self(*this) {}
explicit operator bool() const { return (bool)driver; }
auto reset() -> void { driver.reset(); }
Video() : self(*this) { reset(); }
explicit operator bool() { return instance->driver() != "None"; }
auto reset() -> void { instance = new VideoDriver(*this); }
auto create(string driver = "") -> bool;
auto driverName() -> string { return driver->driverName(); }
auto ready() -> bool { return driver->ready(); }
auto driver() -> string { return instance->driver(); }
auto ready() -> bool { return instance->ready(); }
auto hasExclusive() -> bool { return driver->hasExclusive(); }
auto hasContext() -> bool { return driver->hasContext(); }
auto hasBlocking() -> bool { return driver->hasBlocking(); }
auto hasFlush() -> bool { return driver->hasFlush(); }
auto hasFormats() -> vector<string> { return driver->hasFormats(); }
auto hasSmooth() -> bool { return driver->hasSmooth(); }
auto hasShader() -> bool { return driver->hasShader(); }
auto hasExclusive() -> bool { return instance->hasExclusive(); }
auto hasContext() -> bool { return instance->hasContext(); }
auto hasBlocking() -> bool { return instance->hasBlocking(); }
auto hasFlush() -> bool { return instance->hasFlush(); }
auto hasFormats() -> vector<string> { return instance->hasFormats(); }
auto hasSmooth() -> bool { return instance->hasSmooth(); }
auto hasShader() -> bool { return instance->hasShader(); }
auto hasFormat(string format) -> bool { return driver->hasFormat(format); }
auto hasFormat(string format) -> bool { return instance->hasFormat(format); }
auto exclusive() -> bool { return driver->exclusive; }
auto context() -> uintptr { return driver->context; }
auto blocking() -> bool { return driver->blocking; }
auto flush() -> bool { return driver->flush; }
auto format() -> string { return driver->format; }
auto smooth() -> bool { return driver->smooth; }
auto shader() -> string { return driver->shader; }
auto exclusive() -> bool { return instance->exclusive; }
auto context() -> uintptr { return instance->context; }
auto blocking() -> bool { return instance->blocking; }
auto flush() -> bool { return instance->flush; }
auto format() -> string { return instance->format; }
auto smooth() -> bool { return instance->smooth; }
auto shader() -> string { return instance->shader; }
auto setExclusive(bool exclusive) -> bool;
auto setContext(uintptr context) -> bool;
@@ -95,6 +95,6 @@ struct Video {
protected:
Video& self;
unique_pointer<VideoDriver> driver;
unique_pointer<VideoDriver> instance;
function<void (uint, uint)> update;
};

View File

@@ -18,7 +18,7 @@ struct VideoXShm : VideoDriver {
return initialize();
}
auto driverName() -> string override { return "XShm"; }
auto driver() -> string override { return "XShm"; }
auto ready() -> bool override { return _ready; }
auto hasContext() -> bool override { return true; }