struct IRenderer {
public:
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, 0xD4)(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);
}
};