Counter Strike : Global Offensive Source Code
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

50 lines
1.5 KiB

  1. //===== Copyright � 2013-2013, Valve Corporation, All rights reserved. ======//
  2. //
  3. // Purpose: Class to help with rendering CMDLs & CMergedMDLs to textures.
  4. //
  5. //===========================================================================//
  6. #ifndef RENDER_TO_RT_HELPER_H
  7. #define RENDER_TO_RT_HELPER_H
  8. #if defined( _WIN32 )
  9. #pragma once
  10. #endif
  11. #include "utllinkedlist.h"
  12. #include "irendertorthelperobject.h"
  13. //-----------------------------------------------------------------------------
  14. // Forward declarations
  15. //-----------------------------------------------------------------------------
  16. class IVTFTexture;
  17. class ITexture;
  18. class CThreadEvent;
  19. class CRenderToRTHelper : public IRenderToRTHelper
  20. {
  21. public:
  22. CRenderToRTHelper();
  23. virtual ~CRenderToRTHelper();
  24. // Methods of IRenderToRTHelper
  25. virtual bool Init();
  26. virtual void Shutdown();
  27. virtual RenderToRTData_t *CreateRenderToRTData( IRenderToRTHelperObject *pObject, IVTFTexture *pResultVTF );
  28. virtual void StartRenderToRT( RenderToRTData_t *pRendertoRTData );
  29. virtual void DestroyRenderToRTData( RenderToRTData_t *pRendertoRTData );
  30. virtual bool Process();
  31. void LookAt( Camera_t &camera, const Vector &vecCenter, float flRadius, QAngle cameraAngles, Vector cameraOffset );
  32. private:
  33. CUtlLinkedList< RenderToRTData_t * > m_objectsToRender;
  34. RenderToRTData_t *m_pCurrentObjectToRender;
  35. MaterialLightingState_t m_LightingState;
  36. CThreadEvent *m_pPixelsReadEvent;
  37. ITexture *m_pRenderTarget;
  38. };
  39. #endif // RENDER_TO_RT_HELPER_H