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.

91 lines
2.1 KiB

  1. //===== Copyright � 1996-2005, Valve Corporation, All rights reserved. ======//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //===========================================================================//
  7. #ifndef VMTPANEL_H
  8. #define VMTPANEL_H
  9. #ifdef _WIN32
  10. #pragma once
  11. #endif
  12. #include "matsys_controls/potterywheelpanel.h"
  13. //-----------------------------------------------------------------------------
  14. // Forward declarations
  15. //-----------------------------------------------------------------------------
  16. class IMaterial;
  17. class CMeshBuilder;
  18. class Vector;
  19. namespace vgui
  20. {
  21. class ScrollBar;
  22. class IScheme;
  23. }
  24. //-----------------------------------------------------------------------------
  25. // Material Viewer Panel
  26. //-----------------------------------------------------------------------------
  27. class CVMTPanel : public CPotteryWheelPanel
  28. {
  29. DECLARE_CLASS_SIMPLE( CVMTPanel, CPotteryWheelPanel );
  30. public:
  31. // constructor, destructor
  32. CVMTPanel( vgui::Panel *pParent, const char *pName );
  33. virtual ~CVMTPanel();
  34. // Set the material to draw
  35. void SetMaterial( IMaterial *pMaterial );
  36. // Set rendering mode (stretch to full screen, or use actual size)
  37. void RenderUsingActualSize( bool bEnable );
  38. // performs the layout
  39. virtual void PerformLayout();
  40. virtual void ApplySchemeSettings( vgui::IScheme *pScheme );
  41. private:
  42. // paint it stretched to the window size
  43. void DrawStretchedToPanel( CMeshBuilder &meshBuilder );
  44. // paint it actual size
  45. void DrawActualSize( CMeshBuilder &meshBuilder );
  46. // Draw it on a sphere
  47. void RenderSphere( const Vector &vCenter, float flRadius, int nTheta, int nPhi );
  48. // paint it!
  49. virtual void OnPaint3D();
  50. private:
  51. // The material to draw
  52. IMaterial *m_pMaterial;
  53. // A texture to use for a lightmap
  54. CTextureReference m_pLightmapTexture;
  55. // The default env_cubemap
  56. CTextureReference m_DefaultEnvCubemap;
  57. // Are we using actual size or not?
  58. bool m_bUseActualSize;
  59. // Scroll bars
  60. vgui::ScrollBar *m_pHorizontalBar;
  61. vgui::ScrollBar *m_pVerticalBar;
  62. // The viewable size
  63. int m_iViewableWidth;
  64. int m_iViewableHeight;
  65. };
  66. #endif // VMTPANEL_H