struct CRenderer {
char pad_0x000000[0x14C800]; //0x000000
char m_WinTitle[80]; //0x14C800
HINSTANCE m_hInst; //0x14C850
HWND m_hWnd; //0x14C858
HWND m_hWndDesktop; //0x14C860
HWND m_hWnd2; //0x14C868
HWND m_HwndBrowser; //0x14C870
int m_desktopWidth; //0x14C878
int m_desktopHeight; //0x14C87C
char pad_0x14C880[0x1CC]; //0x14C880
float m_fMemScreenScaleW; //0x14CA4C
float m_fMemScreenScaleH; //0x14CA50
float m_fMemScreenMinScaleW; //0x14CA54
float m_fMemScreenMaxScaleW; //0x14CA58
int m_iMemScreenCompression; //0x14CA5C
IGPUProfiler* m_profiler; //0x14CA60
ID3D11RenderTargetView* m_pBackBuffer; //0x14CA68
ID3D11RenderTargetView* m_pSecondBackBuffer; //0x14CA70
ID3D11RenderTargetView* m_pZBuffer; //0x14CA78
IDXGISwapChain* m_pSwapChain; //0x14CA80
char pad_0x14CA88[0xD8]; //0x14CA88
ID3D11Device* m_pd3dDevice; //0x14CB60
ID3D11Device* m_pActuald3dDevice; //0x14CB68
ID3D11DeviceContext* m_pd3dDeviceContext; //0x14CB70
ID3D11DeviceContext* m_pActuald3dDeviceContext; //0x14CB78
ID3D11InputLayout* m_pLastVDeclaration; //0x14CB80
};
struct IRenderer : public CRenderer {
float GetWidth() { return (float)CallFunction<int(__fastcall*)(PVOID)>(this, 0x320)(this); }
float GetHeight() { return (float)CallFunction<int(__fastcall*)(PVOID)>(this, 0x328)(this); }
void DrawDynVB(SVF_P3F_C4B_T2F* pBuf, uint16_t* pInds, int nVerts, int nInds, int nPrimType)
{
CallFunction<void(__fastcall*)(PVOID, SVF_P3F_C4B_T2F*, uint16_t*, int, int, int)>(this, 0x1F8)(this, pBuf, pInds, nVerts, nInds, nPrimType);
}
void Set2DMode(bool enable, int ortox, int ortoy, float znear = -1e10f, float zfar = 1e10f)
{
CallFunction<void(__fastcall*)(PVOID, bool, int, int, float, float)>(this, 0x8B0)(this, enable, ortox, ortoy, znear, zfar);
}
void SetWhiteTexture() { CallFunction<void(__fastcall*)(PVOID)>(this, 0x238)(this); }
void SetState(int State, int AlphaRef = -1) { CallFunction<void(__fastcall*)(PVOID, int, int)>(this, 212)(this, State, AlphaRef); }
void SetCullMode(int mode) { CallFunction<void(__fastcall*)(PVOID, int)>(this, 0x738)(this, mode); }
void PreRender() {
Set2DMode(true, GetWidth(), GetHeight());
}
void PostRender() {
Set2DMode(false, 0, 0);
}
void DrawPrimitive(eRenderPrimitiveType PrimitiveType, const std::initializer_list<SVF_P3F_C4B_T2F> pBuf, const std::initializer_list<uint16_t> pInds) {
SetWhiteTexture();
DrawDynVB((SVF_P3F_C4B_T2F*)pBuf.begin(), (uint16_t*)pInds.begin(), (int)pBuf.size(), (int)pInds.size(), PrimitiveType);
}
Vec3 GetViewCamera() { return pViewCamera; }
private:
char pad_0x0000[0x1740]; //0x0000
Vec3 pViewCamera; //0x1740
};