Team Fortress 2 Source Code as on 22/4/2020
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.

45 lines
1.2 KiB

  1. //=========== Copyright Valve Corporation, All rights reserved. ===============//
  2. //
  3. // Purpose:
  4. //=============================================================================//
  5. #ifndef PANORAMA_RENDERPANEL_H
  6. #define PANORAMA_RENDERPANEL_H
  7. #ifdef _WIN32
  8. #pragma once
  9. #endif
  10. #include "panorama/controls/panel2d.h"
  11. #include "materialsystem2/imaterialsystem2utils.h"
  12. namespace panorama
  13. {
  14. //-----------------------------------------------------------------------------
  15. // Purpose: Render panel, to use for raw source2 render operations directly in render thread
  16. //-----------------------------------------------------------------------------
  17. class CRenderPanel : public CPanel2D
  18. {
  19. DECLARE_PANEL2D( CRenderPanel, CPanel2D );
  20. public:
  21. CRenderPanel( CPanel2D *parent, const char * pchPanelID );
  22. virtual ~CRenderPanel();
  23. void SetRenderThreadCallback( CRenderThreadCallback *pRenderCallback );
  24. // Override and make return true if you need to paint every single frame, and will not manually call SetRepaint when you want to repaint
  25. virtual bool BShouldAlwaysRepaint() { return true; }
  26. protected:
  27. // Override of Panel2D paint
  28. virtual void Paint() OVERRIDE;
  29. private:
  30. CRenderThreadCallback *m_pRenderCallback;
  31. };
  32. } // namespace panorama
  33. #endif // PANORAMA_RENDERPANEL_H