* improved appended firmware detection [devinacker]
* added dynamic rate control support to ALSA and PulseAudio drivers [RedDwarf]
* added option to use native file dialogs
This commit is contained in:
byuu
2020-02-23 20:23:25 +09:00
parent c13745d753
commit d2211d8818
63 changed files with 1091 additions and 1154 deletions

View File

@@ -66,6 +66,10 @@ struct VideoCGL : VideoDriver, OpenGL {
return true;
}
auto focused() -> bool override {
return true;
}
auto clear() -> void override {
@autoreleasepool {
[view lockFocus];

View File

@@ -34,6 +34,12 @@ struct VideoDirect3D : VideoDriver {
auto setBlocking(bool blocking) -> bool override { return true; }
auto setShader(string shader) -> bool override { return updateFilter(); }
auto focused() -> bool override {
if(self.fullScreen && self.exclusive) return true;
auto focused = GetFocus();
return _context == focused || IsChild(_context, focused);
}
auto clear() -> void override {
if(_lost && !recover()) return;

View File

@@ -40,6 +40,12 @@ struct VideoDirectDraw : VideoDriver {
return true;
}
auto focused() -> bool override {
if(self.fullScreen && self.exclusive) return true;
auto focused = GetFocus();
return _context == focused || IsChild(_context, focused);
}
auto clear() -> void override {
DDBLTFX fx{};
fx.dwSize = sizeof(DDBLTFX);

View File

@@ -24,6 +24,12 @@ struct VideoGDI : VideoDriver {
auto setMonitor(string monitor) -> bool override { return initialize(); }
auto setContext(uintptr context) -> bool override { return initialize(); }
auto focused() -> bool override {
if(self.fullScreen && self.exclusive) return true;
auto focused = GetFocus();
return _context == focused || IsChild(_context, focused);
}
auto size(uint& width, uint& height) -> void override {
RECT rectangle;
GetClientRect(_context, &rectangle);

View File

@@ -74,6 +74,10 @@ struct VideoGLX : VideoDriver, OpenGL {
return true;
}
auto focused() -> bool override {
return true;
}
auto clear() -> void override {
OpenGL::clear();
if(_doubleBuffer) glXSwapBuffers(_display, _glXWindow);

View File

@@ -83,6 +83,10 @@ struct VideoGLX2 : VideoDriver {
return true;
}
auto focused() -> bool override {
return true;
}
auto clear() -> void override {
memory::fill<uint32_t>(_glBuffer, _glWidth * _glHeight);
glClearColor(0.0, 0.0, 0.0, 1.0);

View File

@@ -94,6 +94,10 @@ auto Video::setShader(string shader) -> bool {
//
auto Video::focused() -> bool {
return instance->focused();
}
auto Video::clear() -> void {
return instance->clear();
}

View File

@@ -28,6 +28,7 @@ struct VideoDriver {
virtual auto setFormat(string format) -> bool { return true; }
virtual auto setShader(string shader) -> bool { return true; }
virtual auto focused() -> bool { return true; }
virtual auto clear() -> void {}
virtual auto size(uint& width, uint& height) -> void {}
virtual auto acquire(uint32_t*& data, uint& pitch, uint width, uint height) -> bool { return false; }
@@ -108,6 +109,7 @@ struct Video {
auto setFormat(string format) -> bool;
auto setShader(string shader) -> bool;
auto focused() -> bool;
auto clear() -> void;
struct Size {
uint width = 0;

View File

@@ -53,6 +53,12 @@ struct VideoWGL : VideoDriver, OpenGL {
return true;
}
auto focused() -> bool override {
if(self.fullScreen && self.exclusive) return true;
auto focused = GetFocus();
return _context == focused || IsChild(_context, focused);
}
auto clear() -> void override {
OpenGL::clear();
SwapBuffers(_display);

View File

@@ -31,6 +31,10 @@ struct VideoXShm : VideoDriver {
auto setContext(uintptr context) -> bool override { return initialize(); }
auto setShader(string shader) -> bool override { return true; }
auto focused() -> bool override {
return true;
}
auto clear() -> void override {
auto dp = _inputBuffer;
uint length = _inputWidth * _inputHeight;

View File

@@ -57,6 +57,10 @@ struct VideoXVideo : VideoDriver {
return initialize();
}
auto focused() -> bool override {
return true;
}
auto clear() -> void override {
memory::fill<uint32_t>(_buffer, _bufferWidth * _bufferHeight);
//clear twice in case video is double buffered ...