2017-01-20 08:36:52 -05:00
|
|
|
#pragma once
|
|
|
|
|
2017-01-19 16:23:59 -05:00
|
|
|
namespace Components
|
|
|
|
{
|
|
|
|
class Renderer : public Component
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
typedef void(BackendCallback)(IDirect3DDevice9*);
|
2022-05-05 10:03:14 -04:00
|
|
|
typedef void(Callback)();
|
2017-01-19 16:23:59 -05:00
|
|
|
|
|
|
|
Renderer();
|
|
|
|
~Renderer();
|
|
|
|
|
|
|
|
static int Width();
|
|
|
|
static int Height();
|
|
|
|
|
|
|
|
static void OnBackendFrame(Utils::Slot<BackendCallback> callback);
|
2017-06-22 16:05:22 -04:00
|
|
|
static void OnNextBackendFrame(Utils::Slot<BackendCallback> callback);
|
2017-01-19 16:23:59 -05:00
|
|
|
|
2022-05-05 10:03:14 -04:00
|
|
|
static void OnDeviceRecoveryEnd(Utils::Slot<Renderer::Callback> callback);
|
|
|
|
static void OnDeviceRecoveryBegin(Utils::Slot<Renderer::Callback> callback);
|
2017-01-19 16:23:59 -05:00
|
|
|
|
2022-05-05 10:03:14 -04:00
|
|
|
private:
|
2017-01-19 16:23:59 -05:00
|
|
|
static void BackendFrameStub();
|
|
|
|
static void BackendFrameHandler();
|
|
|
|
|
2017-06-06 08:02:56 -04:00
|
|
|
static void PreVidRestart();
|
|
|
|
static void PostVidRestart();
|
|
|
|
static void PostVidRestartStub();
|
|
|
|
|
2018-12-24 15:42:39 -05:00
|
|
|
static void R_TextureFromCodeError(const char* sampler, Game::GfxCmdBufState* state);
|
|
|
|
static void StoreGfxBufContextPtrStub1();
|
|
|
|
static void StoreGfxBufContextPtrStub2();
|
|
|
|
|
2018-12-25 16:47:10 -05:00
|
|
|
static int DrawTechsetForMaterial(int a1, float a2, float a3, const char* material, Game::vec4_t* color, int a6);
|
|
|
|
|
2021-11-07 16:48:52 -05:00
|
|
|
static void DebugDrawTriggers();
|
|
|
|
static void DebugDrawSceneModelCollisions();
|
2021-11-08 11:56:19 -05:00
|
|
|
static void DebugDrawModelBoundingBoxes();
|
2021-11-07 16:48:52 -05:00
|
|
|
static void DebugDrawModelNames();
|
|
|
|
static void DebugDrawAABBTrees();
|
2022-12-14 03:40:15 -05:00
|
|
|
static void ForceTechnique();
|
|
|
|
|
|
|
|
static int FixSunShadowPartitionSize(Game::GfxCamera* camera, Game::GfxSunShadowMapMetrics* mapMetrics, Game::GfxSunShadow* sunShadow, Game::GfxSunShadowClip* clip, float* partitionFraction);
|
2021-11-07 16:48:52 -05:00
|
|
|
|
2022-05-05 10:03:14 -04:00
|
|
|
static Utils::Signal<Renderer::Callback> EndRecoverDeviceSignal;
|
|
|
|
static Utils::Signal<Renderer::Callback> BeginRecoverDeviceSignal;
|
2017-01-19 16:23:59 -05:00
|
|
|
|
|
|
|
static Utils::Signal<BackendCallback> BackendFrameSignal;
|
2017-06-22 16:05:22 -04:00
|
|
|
static Utils::Signal<BackendCallback> SingleBackendFrameSignal;
|
2021-11-07 16:48:52 -05:00
|
|
|
|
2021-11-11 08:00:46 -05:00
|
|
|
static Dvar::Var r_drawTriggers;
|
|
|
|
static Dvar::Var r_drawSceneModelCollisions;
|
|
|
|
static Dvar::Var r_drawModelBoundingBoxes;
|
|
|
|
static Dvar::Var r_drawModelNames;
|
|
|
|
static Dvar::Var r_drawAABBTrees;
|
|
|
|
static Dvar::Var r_playerDrawDebugDistance;
|
2022-12-14 03:40:15 -05:00
|
|
|
static Dvar::Var r_forceTechnique;
|
2017-01-19 16:23:59 -05:00
|
|
|
};
|
|
|
|
}
|