diff --git a/src/gx/CGxDevice.hpp b/src/gx/CGxDevice.hpp index 38621a8..83c39b6 100644 --- a/src/gx/CGxDevice.hpp +++ b/src/gx/CGxDevice.hpp @@ -106,6 +106,7 @@ class CGxDevice { virtual void ICursorCreate(const CGxFormat& format); virtual int32_t DeviceCreate(int32_t (*windowProc)(void* window, uint32_t message, uintptr_t wparam, intptr_t lparam), const CGxFormat&); virtual int32_t DeviceSetFormat(const CGxFormat&); + virtual void* DeviceWindow() = 0; virtual void DeviceWM(EGxWM wm, uintptr_t param1, uintptr_t param2) = 0; virtual void CapsWindowSize(CRect&) = 0; virtual void CapsWindowSizeInScreenCoords(CRect& dst) = 0; diff --git a/src/gx/Device.cpp b/src/gx/Device.cpp index 1c584c8..7daa8ac 100644 --- a/src/gx/Device.cpp +++ b/src/gx/Device.cpp @@ -46,6 +46,10 @@ EGxApi GxDevApi() { return g_theGxDevicePtr->m_api; } +void* GxDevWindow() { + return g_theGxDevicePtr->DeviceWindow(); +} + int32_t GxMasterEnable(EGxMasterEnables state) { return g_theGxDevicePtr->MasterEnable(state); } diff --git a/src/gx/Device.hpp b/src/gx/Device.hpp index 9c3f544..7ead52b 100644 --- a/src/gx/Device.hpp +++ b/src/gx/Device.hpp @@ -13,6 +13,8 @@ CGxDevice* GxDevCreate(EGxApi api, int32_t (*windowProc)(void* window, uint32_t EGxApi GxDevApi(void); +void* GxDevWindow(); + int32_t GxMasterEnable(EGxMasterEnables state); #endif diff --git a/src/gx/d3d/CGxDeviceD3d.cpp b/src/gx/d3d/CGxDeviceD3d.cpp index 4e1e125..433a76e 100644 --- a/src/gx/d3d/CGxDeviceD3d.cpp +++ b/src/gx/d3d/CGxDeviceD3d.cpp @@ -487,6 +487,10 @@ int32_t CGxDeviceD3d::DeviceSetFormat(const CGxFormat& format) { } } +void* CGxDeviceD3d::DeviceWindow() { + return this->m_hwnd; +} + void CGxDeviceD3d::DeviceWM(EGxWM wm, uintptr_t param1, uintptr_t param2) { switch (wm) { case GxWM_Size: { diff --git a/src/gx/d3d/CGxDeviceD3d.hpp b/src/gx/d3d/CGxDeviceD3d.hpp index fa39c94..7aec4e3 100644 --- a/src/gx/d3d/CGxDeviceD3d.hpp +++ b/src/gx/d3d/CGxDeviceD3d.hpp @@ -247,6 +247,7 @@ class CGxDeviceD3d : public CGxDevice { virtual void IRsSendToHw(EGxRenderState which); virtual int32_t DeviceCreate(int32_t (*windowProc)(void* window, uint32_t message, uintptr_t wparam, intptr_t lparam), const CGxFormat& format); virtual int32_t DeviceSetFormat(const CGxFormat& format); + virtual void* DeviceWindow(); virtual void DeviceWM(EGxWM wm, uintptr_t param1, uintptr_t param2); virtual void CapsWindowSize(CRect& dst); virtual void CapsWindowSizeInScreenCoords(CRect& dst); diff --git a/src/gx/gll/CGxDeviceGLL.cpp b/src/gx/gll/CGxDeviceGLL.cpp index 6acc8e8..db0bc25 100644 --- a/src/gx/gll/CGxDeviceGLL.cpp +++ b/src/gx/gll/CGxDeviceGLL.cpp @@ -334,6 +334,10 @@ int32_t CGxDeviceGLL::DeviceSetFormat(const CGxFormat& format) { return 1; } +void* CGxDeviceGLL::DeviceWindow() { + return &this->m_glWindow; +} + void CGxDeviceGLL::Draw(CGxBatch* batch, int32_t indexed) { if (!this->m_context) { return; diff --git a/src/gx/gll/CGxDeviceGLL.hpp b/src/gx/gll/CGxDeviceGLL.hpp index 5427801..7f4e44d 100644 --- a/src/gx/gll/CGxDeviceGLL.hpp +++ b/src/gx/gll/CGxDeviceGLL.hpp @@ -31,6 +31,7 @@ class CGxDeviceGLL : public CGxDevice { virtual void IRsSendToHw(EGxRenderState); virtual int32_t DeviceCreate(int32_t (*windowProc)(void* window, uint32_t message, uintptr_t wparam, intptr_t lparam), const CGxFormat&); virtual int32_t DeviceSetFormat(const CGxFormat&); + virtual void* DeviceWindow(); virtual void DeviceWM(EGxWM wm, uintptr_t param1, uintptr_t param2) {}; virtual void CapsWindowSize(CRect&); virtual void CapsWindowSizeInScreenCoords(CRect& dst);