mirror of
https://github.com/thunderbrewhq/thunderbrew
synced 2025-04-18 02:52:47 +03:00
feat(gx): add getter for device window
This commit is contained in:
parent
bfbd7e57ad
commit
acaa42019a
@ -106,6 +106,7 @@ class CGxDevice {
|
|||||||
virtual void ICursorCreate(const CGxFormat& format);
|
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 DeviceCreate(int32_t (*windowProc)(void* window, uint32_t message, uintptr_t wparam, intptr_t lparam), const CGxFormat&);
|
||||||
virtual int32_t DeviceSetFormat(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 DeviceWM(EGxWM wm, uintptr_t param1, uintptr_t param2) = 0;
|
||||||
virtual void CapsWindowSize(CRect&) = 0;
|
virtual void CapsWindowSize(CRect&) = 0;
|
||||||
virtual void CapsWindowSizeInScreenCoords(CRect& dst) = 0;
|
virtual void CapsWindowSizeInScreenCoords(CRect& dst) = 0;
|
||||||
|
@ -46,6 +46,10 @@ EGxApi GxDevApi() {
|
|||||||
return g_theGxDevicePtr->m_api;
|
return g_theGxDevicePtr->m_api;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void* GxDevWindow() {
|
||||||
|
return g_theGxDevicePtr->DeviceWindow();
|
||||||
|
}
|
||||||
|
|
||||||
int32_t GxMasterEnable(EGxMasterEnables state) {
|
int32_t GxMasterEnable(EGxMasterEnables state) {
|
||||||
return g_theGxDevicePtr->MasterEnable(state);
|
return g_theGxDevicePtr->MasterEnable(state);
|
||||||
}
|
}
|
||||||
|
@ -13,6 +13,8 @@ CGxDevice* GxDevCreate(EGxApi api, int32_t (*windowProc)(void* window, uint32_t
|
|||||||
|
|
||||||
EGxApi GxDevApi(void);
|
EGxApi GxDevApi(void);
|
||||||
|
|
||||||
|
void* GxDevWindow();
|
||||||
|
|
||||||
int32_t GxMasterEnable(EGxMasterEnables state);
|
int32_t GxMasterEnable(EGxMasterEnables state);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -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) {
|
void CGxDeviceD3d::DeviceWM(EGxWM wm, uintptr_t param1, uintptr_t param2) {
|
||||||
switch (wm) {
|
switch (wm) {
|
||||||
case GxWM_Size: {
|
case GxWM_Size: {
|
||||||
|
@ -247,6 +247,7 @@ class CGxDeviceD3d : public CGxDevice {
|
|||||||
virtual void IRsSendToHw(EGxRenderState which);
|
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 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 int32_t DeviceSetFormat(const CGxFormat& format);
|
||||||
|
virtual void* DeviceWindow();
|
||||||
virtual void DeviceWM(EGxWM wm, uintptr_t param1, uintptr_t param2);
|
virtual void DeviceWM(EGxWM wm, uintptr_t param1, uintptr_t param2);
|
||||||
virtual void CapsWindowSize(CRect& dst);
|
virtual void CapsWindowSize(CRect& dst);
|
||||||
virtual void CapsWindowSizeInScreenCoords(CRect& dst);
|
virtual void CapsWindowSizeInScreenCoords(CRect& dst);
|
||||||
|
@ -334,6 +334,10 @@ int32_t CGxDeviceGLL::DeviceSetFormat(const CGxFormat& format) {
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void* CGxDeviceGLL::DeviceWindow() {
|
||||||
|
return &this->m_glWindow;
|
||||||
|
}
|
||||||
|
|
||||||
void CGxDeviceGLL::Draw(CGxBatch* batch, int32_t indexed) {
|
void CGxDeviceGLL::Draw(CGxBatch* batch, int32_t indexed) {
|
||||||
if (!this->m_context) {
|
if (!this->m_context) {
|
||||||
return;
|
return;
|
||||||
|
@ -31,6 +31,7 @@ class CGxDeviceGLL : public CGxDevice {
|
|||||||
virtual void IRsSendToHw(EGxRenderState);
|
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 DeviceCreate(int32_t (*windowProc)(void* window, uint32_t message, uintptr_t wparam, intptr_t lparam), const CGxFormat&);
|
||||||
virtual int32_t DeviceSetFormat(const CGxFormat&);
|
virtual int32_t DeviceSetFormat(const CGxFormat&);
|
||||||
|
virtual void* DeviceWindow();
|
||||||
virtual void DeviceWM(EGxWM wm, uintptr_t param1, uintptr_t param2) {};
|
virtual void DeviceWM(EGxWM wm, uintptr_t param1, uintptr_t param2) {};
|
||||||
virtual void CapsWindowSize(CRect&);
|
virtual void CapsWindowSize(CRect&);
|
||||||
virtual void CapsWindowSizeInScreenCoords(CRect& dst);
|
virtual void CapsWindowSizeInScreenCoords(CRect& dst);
|
||||||
|
Loading…
Reference in New Issue
Block a user