2023-03-05 11:55:12 -06:00
|
|
|
#ifndef GX_D3D_C_GX_DEVICE_D3D_HPP
|
|
|
|
|
#define GX_D3D_C_GX_DEVICE_D3D_HPP
|
|
|
|
|
|
|
|
|
|
#include "gx/CGxDevice.hpp"
|
|
|
|
|
#include <cstdint>
|
|
|
|
|
#include <d3d9.h>
|
|
|
|
|
#include <windows.h>
|
|
|
|
|
|
|
|
|
|
class CGxDeviceD3d : public CGxDevice {
|
|
|
|
|
public:
|
|
|
|
|
// Static functions
|
|
|
|
|
static int32_t ILoadD3dLib(HINSTANCE& d3dLib, LPDIRECT3D9& d3d);
|
|
|
|
|
static void IUnloadD3dLib(HINSTANCE& d3dLib, LPDIRECT3D9& d3d);
|
|
|
|
|
static LRESULT WindowProcD3d(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
|
|
|
|
|
|
|
|
|
|
// Member variables
|
2023-03-05 16:13:31 -06:00
|
|
|
HWND m_hwnd;
|
2023-03-05 11:55:12 -06:00
|
|
|
ATOM m_hwndClass;
|
|
|
|
|
int32_t m_ownhwnd;
|
|
|
|
|
HINSTANCE m_d3dLib;
|
|
|
|
|
LPDIRECT3D9 m_d3d;
|
|
|
|
|
LPDIRECT3DDEVICE9 m_d3dDevice;
|
|
|
|
|
D3DCAPS9 m_d3dCaps;
|
|
|
|
|
D3DDISPLAYMODE m_desktopDisplayMode;
|
|
|
|
|
|
|
|
|
|
// Virtual member functions
|
|
|
|
|
virtual void ITexMarkAsUpdated(CGxTex* texId);
|
|
|
|
|
virtual void IRsSendToHw(EGxRenderState rs);
|
|
|
|
|
virtual int32_t DeviceCreate(long (*windowProc)(void*, uint32_t, uint32_t, long), const CGxFormat& format);
|
2023-03-05 16:13:31 -06:00
|
|
|
virtual int32_t DeviceSetFormat(const CGxFormat& format);
|
2023-03-05 11:55:12 -06:00
|
|
|
virtual void CapsWindowSize(CRect& dst);
|
|
|
|
|
virtual void CapsWindowSizeInScreenCoords(CRect& dst);
|
|
|
|
|
virtual void PoolSizeSet(CGxPool* pool, uint32_t size);
|
|
|
|
|
virtual void IShaderCreate(CGxShader* shader);
|
|
|
|
|
virtual int32_t StereoEnabled();
|
|
|
|
|
|
|
|
|
|
// Member functions
|
|
|
|
|
int32_t ICreateD3d();
|
2023-03-05 16:13:31 -06:00
|
|
|
int32_t ICreateD3dDevice(const CGxFormat& format);
|
|
|
|
|
bool ICreateWindow(CGxFormat& format);
|
2023-03-05 11:55:12 -06:00
|
|
|
void IDestroyD3d();
|
|
|
|
|
void IDestroyD3dDevice();
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif
|