2018-08-05 09:00:15 +00:00
|
|
|
struct VideoGDI : VideoDriver {
|
|
|
|
VideoGDI& self = *this;
|
|
|
|
VideoGDI(Video& super) : VideoDriver(super) {}
|
2017-07-24 05:23:40 +00:00
|
|
|
~VideoGDI() { terminate(); }
|
2010-08-09 13:28:56 +00:00
|
|
|
|
2018-08-05 09:00:15 +00:00
|
|
|
auto create() -> bool override {
|
2018-08-21 03:17:12 +00:00
|
|
|
super.setShader("None");
|
2018-08-05 09:00:15 +00:00
|
|
|
return initialize();
|
|
|
|
}
|
|
|
|
|
Update to 20180729 release.
byuu wrote:
Sigh ...
asio.hpp needs #include <nall/windows/registry.hpp>
[Since the last WIP, byuu also posted the following message. -Ed.]
ruby drivers have all been updated (but not tested outside of BSD), and
I redesigned the settings window. The driver functionality all exists on
a new "Drivers" panel, the emulator/hack settings go to a
"Configuration" panel, and the video/audio panels lose driver settings.
As does the settings menu and its synchronize options.
I want to start pushing toward a v107 release. Critically, I will need
DirectSound and ALSA to support dynamic rate control. I'd also like to
eliminate the other system manifest.bml files. I need to update the
cheat code database format, and bundle at least a few quark shaders --
although I still need to default to Direct3D on Windows.
Turbo keys would be nice, if it's not too much effort. Aside from
netplay, it's the last significant feature I'm missing.
I think for v107, higan is going to be a bit rough around the edges
compared to bsnes. And I don't think it's practical to finish the bsnes
localization support.
I'm thinking we probably want another WIP to iron out any critical
issues, but this time there should be a feature freeze with the next
WIP.
2018-07-29 13:24:38 +00:00
|
|
|
auto driver() -> string override { return "GDI"; }
|
|
|
|
auto ready() -> bool override { return _ready; }
|
2010-08-09 13:28:56 +00:00
|
|
|
|
Update to 20180729 release.
byuu wrote:
Sigh ...
asio.hpp needs #include <nall/windows/registry.hpp>
[Since the last WIP, byuu also posted the following message. -Ed.]
ruby drivers have all been updated (but not tested outside of BSD), and
I redesigned the settings window. The driver functionality all exists on
a new "Drivers" panel, the emulator/hack settings go to a
"Configuration" panel, and the video/audio panels lose driver settings.
As does the settings menu and its synchronize options.
I want to start pushing toward a v107 release. Critically, I will need
DirectSound and ALSA to support dynamic rate control. I'd also like to
eliminate the other system manifest.bml files. I need to update the
cheat code database format, and bundle at least a few quark shaders --
although I still need to default to Direct3D on Windows.
Turbo keys would be nice, if it's not too much effort. Aside from
netplay, it's the last significant feature I'm missing.
I think for v107, higan is going to be a bit rough around the edges
compared to bsnes. And I don't think it's practical to finish the bsnes
localization support.
I'm thinking we probably want another WIP to iron out any critical
issues, but this time there should be a feature freeze with the next
WIP.
2018-07-29 13:24:38 +00:00
|
|
|
auto hasContext() -> bool override { return true; }
|
2010-08-09 13:28:56 +00:00
|
|
|
|
2018-08-05 09:00:15 +00:00
|
|
|
auto setContext(uintptr context) -> bool override { return initialize(); }
|
2010-08-09 13:28:56 +00:00
|
|
|
|
Update to 20180729 release.
byuu wrote:
Sigh ...
asio.hpp needs #include <nall/windows/registry.hpp>
[Since the last WIP, byuu also posted the following message. -Ed.]
ruby drivers have all been updated (but not tested outside of BSD), and
I redesigned the settings window. The driver functionality all exists on
a new "Drivers" panel, the emulator/hack settings go to a
"Configuration" panel, and the video/audio panels lose driver settings.
As does the settings menu and its synchronize options.
I want to start pushing toward a v107 release. Critically, I will need
DirectSound and ALSA to support dynamic rate control. I'd also like to
eliminate the other system manifest.bml files. I need to update the
cheat code database format, and bundle at least a few quark shaders --
although I still need to default to Direct3D on Windows.
Turbo keys would be nice, if it's not too much effort. Aside from
netplay, it's the last significant feature I'm missing.
I think for v107, higan is going to be a bit rough around the edges
compared to bsnes. And I don't think it's practical to finish the bsnes
localization support.
I'm thinking we probably want another WIP to iron out any critical
issues, but this time there should be a feature freeze with the next
WIP.
2018-07-29 13:24:38 +00:00
|
|
|
auto acquire(uint32_t*& data, uint& pitch, uint width, uint height) -> bool override {
|
2017-07-24 05:23:40 +00:00
|
|
|
if(!_buffer || _width != width || _height != height) {
|
|
|
|
if(_buffer) delete[] _buffer;
|
|
|
|
if(_bitmap) DeleteObject(_bitmap);
|
|
|
|
if(_dc) DeleteObject(_dc);
|
|
|
|
|
|
|
|
_buffer = new uint32_t[width * height]();
|
|
|
|
_width = width;
|
|
|
|
_height = height;
|
|
|
|
|
2018-08-05 09:00:15 +00:00
|
|
|
HDC hdc = GetDC((HWND)self.context);
|
2017-07-24 05:23:40 +00:00
|
|
|
_dc = CreateCompatibleDC(hdc);
|
|
|
|
_bitmap = CreateCompatibleBitmap(hdc, width, height);
|
|
|
|
SelectObject(_dc, _bitmap);
|
2018-08-05 09:00:15 +00:00
|
|
|
ReleaseDC((HWND)self.context, hdc);
|
2017-07-24 05:23:40 +00:00
|
|
|
|
|
|
|
memory::fill(&_info, sizeof(BITMAPINFO));
|
|
|
|
_info.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
|
|
|
|
_info.bmiHeader.biWidth = width;
|
|
|
|
_info.bmiHeader.biHeight = -height;
|
|
|
|
_info.bmiHeader.biPlanes = 1;
|
|
|
|
_info.bmiHeader.biBitCount = 32;
|
|
|
|
_info.bmiHeader.biCompression = BI_RGB;
|
|
|
|
_info.bmiHeader.biSizeImage = width * height * sizeof(uint32_t);
|
2017-05-30 07:48:41 +00:00
|
|
|
}
|
2010-08-09 13:28:56 +00:00
|
|
|
|
2017-07-24 05:23:40 +00:00
|
|
|
pitch = _width * sizeof(uint32_t);
|
|
|
|
return data = _buffer;
|
2010-08-09 13:28:56 +00:00
|
|
|
}
|
|
|
|
|
Update to 20180729 release.
byuu wrote:
Sigh ...
asio.hpp needs #include <nall/windows/registry.hpp>
[Since the last WIP, byuu also posted the following message. -Ed.]
ruby drivers have all been updated (but not tested outside of BSD), and
I redesigned the settings window. The driver functionality all exists on
a new "Drivers" panel, the emulator/hack settings go to a
"Configuration" panel, and the video/audio panels lose driver settings.
As does the settings menu and its synchronize options.
I want to start pushing toward a v107 release. Critically, I will need
DirectSound and ALSA to support dynamic rate control. I'd also like to
eliminate the other system manifest.bml files. I need to update the
cheat code database format, and bundle at least a few quark shaders --
although I still need to default to Direct3D on Windows.
Turbo keys would be nice, if it's not too much effort. Aside from
netplay, it's the last significant feature I'm missing.
I think for v107, higan is going to be a bit rough around the edges
compared to bsnes. And I don't think it's practical to finish the bsnes
localization support.
I'm thinking we probably want another WIP to iron out any critical
issues, but this time there should be a feature freeze with the next
WIP.
2018-07-29 13:24:38 +00:00
|
|
|
auto release() -> void override {
|
2017-07-24 05:23:40 +00:00
|
|
|
}
|
2010-08-09 13:28:56 +00:00
|
|
|
|
Update to 20180729 release.
byuu wrote:
Sigh ...
asio.hpp needs #include <nall/windows/registry.hpp>
[Since the last WIP, byuu also posted the following message. -Ed.]
ruby drivers have all been updated (but not tested outside of BSD), and
I redesigned the settings window. The driver functionality all exists on
a new "Drivers" panel, the emulator/hack settings go to a
"Configuration" panel, and the video/audio panels lose driver settings.
As does the settings menu and its synchronize options.
I want to start pushing toward a v107 release. Critically, I will need
DirectSound and ALSA to support dynamic rate control. I'd also like to
eliminate the other system manifest.bml files. I need to update the
cheat code database format, and bundle at least a few quark shaders --
although I still need to default to Direct3D on Windows.
Turbo keys would be nice, if it's not too much effort. Aside from
netplay, it's the last significant feature I'm missing.
I think for v107, higan is going to be a bit rough around the edges
compared to bsnes. And I don't think it's practical to finish the bsnes
localization support.
I'm thinking we probably want another WIP to iron out any critical
issues, but this time there should be a feature freeze with the next
WIP.
2018-07-29 13:24:38 +00:00
|
|
|
auto output() -> void override {
|
2010-08-09 13:28:56 +00:00
|
|
|
RECT rc;
|
2018-08-05 09:00:15 +00:00
|
|
|
GetClientRect((HWND)self.context, &rc);
|
2010-08-09 13:28:56 +00:00
|
|
|
|
2017-07-24 05:23:40 +00:00
|
|
|
SetDIBits(_dc, _bitmap, 0, _height, (void*)_buffer, &_info, DIB_RGB_COLORS);
|
2018-08-05 09:00:15 +00:00
|
|
|
HDC hdc = GetDC((HWND)self.context);
|
2017-07-24 05:23:40 +00:00
|
|
|
StretchBlt(hdc, rc.left, rc.top, rc.right, rc.bottom, _dc, 0, 0, _width, _height, SRCCOPY);
|
2018-08-05 09:00:15 +00:00
|
|
|
ReleaseDC((HWND)self.context, hdc);
|
2010-08-09 13:28:56 +00:00
|
|
|
}
|
|
|
|
|
2017-07-24 05:23:40 +00:00
|
|
|
private:
|
|
|
|
auto initialize() -> bool {
|
|
|
|
terminate();
|
2018-08-05 09:00:15 +00:00
|
|
|
if(!self.context) return false;
|
2017-07-24 05:23:40 +00:00
|
|
|
|
|
|
|
_width = 0;
|
|
|
|
_height = 0;
|
|
|
|
return _ready = true;
|
2010-08-09 13:28:56 +00:00
|
|
|
}
|
|
|
|
|
2017-07-24 05:23:40 +00:00
|
|
|
auto terminate() -> void {
|
|
|
|
_ready = false;
|
|
|
|
if(_buffer) { delete[] _buffer; _buffer = nullptr; }
|
|
|
|
if(_bitmap) { DeleteObject(_bitmap); _bitmap = nullptr; }
|
|
|
|
if(_dc) { DeleteDC(_dc); _dc = nullptr; }
|
2010-08-09 13:28:56 +00:00
|
|
|
}
|
2017-07-24 05:23:40 +00:00
|
|
|
|
|
|
|
bool _ready = false;
|
|
|
|
|
|
|
|
uint32_t* _buffer = nullptr;
|
|
|
|
uint _width = 0;
|
|
|
|
uint _height = 0;
|
|
|
|
|
|
|
|
HBITMAP _bitmap = nullptr;
|
|
|
|
HDC _dc = nullptr;
|
|
|
|
BITMAPINFO _info = {};
|
2010-08-09 13:28:56 +00:00
|
|
|
};
|