mirror of
https://github.com/thunderbrewhq/thunderbrew
synced 2025-12-12 19:22:30 +00:00
fix(gx): log what api is being used when initializing device
This commit is contained in:
parent
6fa58683ad
commit
422a36cd93
7 changed files with 24 additions and 3 deletions
|
|
@ -1,15 +1,17 @@
|
|||
#include "gx/Device.hpp"
|
||||
#include "gx/CGxDevice.hpp"
|
||||
#include "gx/Gx.hpp"
|
||||
#include <cstdio>
|
||||
|
||||
CGxDevice* g_theGxDevicePtr = nullptr;
|
||||
|
||||
CGxDevice* GxDevCreate(EGxApi api, int32_t (*windowProc)(void* window, uint32_t message, uintptr_t wparam, intptr_t lparam), const CGxFormat& format) {
|
||||
CGxDevice* device;
|
||||
CGxDevice* device = nullptr;
|
||||
|
||||
switch (api) {
|
||||
case GxApi_OpenGl:
|
||||
device = CGxDevice::NewOpenGl();
|
||||
break;
|
||||
|
||||
#if defined(WHOA_SYSTEM_WIN)
|
||||
case GxApi_D3d9:
|
||||
|
|
@ -41,6 +43,8 @@ CGxDevice* GxDevCreate(EGxApi api, int32_t (*windowProc)(void* window, uint32_t
|
|||
break;
|
||||
}
|
||||
|
||||
STORM_ASSERT(device != nullptr);
|
||||
|
||||
g_theGxDevicePtr = device;
|
||||
|
||||
if (g_theGxDevicePtr->DeviceCreate(windowProc, format)) {
|
||||
|
|
|
|||
|
|
@ -333,7 +333,18 @@ LRESULT CGxDeviceD3d::WindowProcD3d(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM
|
|||
}
|
||||
|
||||
case WM_SETCURSOR: {
|
||||
// TODO
|
||||
if (device) {
|
||||
if (device->m_d3dDevice && lParam == 1) {
|
||||
SetCursor(nullptr);
|
||||
BOOL show = TRUE;
|
||||
// if (device->unk2904[0x13] == 0) || (device->.unk2904[0x14] == 0)) {
|
||||
// show = FALSE;
|
||||
// } else {
|
||||
// show = TRUE;
|
||||
// }
|
||||
device->m_d3dDevice->ShowCursor(show);
|
||||
}
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue