diff options
Diffstat (limited to 'public/matsys_controls/vmtpanel.h')
| -rw-r--r-- | public/matsys_controls/vmtpanel.h | 91 |
1 files changed, 91 insertions, 0 deletions
diff --git a/public/matsys_controls/vmtpanel.h b/public/matsys_controls/vmtpanel.h new file mode 100644 index 0000000..ee2e6cc --- /dev/null +++ b/public/matsys_controls/vmtpanel.h @@ -0,0 +1,91 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: +// +// $NoKeywords: $ +//===========================================================================// + +#ifndef VMTPANEL_H +#define VMTPANEL_H + +#ifdef _WIN32 +#pragma once +#endif + +#include "matsys_controls/potterywheelpanel.h" + + +//----------------------------------------------------------------------------- +// Forward declarations +//----------------------------------------------------------------------------- +class IMaterial; +class CMeshBuilder; +class Vector; + +namespace vgui +{ + class ScrollBar; + class IScheme; +} + + +//----------------------------------------------------------------------------- +// Material Viewer Panel +//----------------------------------------------------------------------------- +class CVMTPanel : public CPotteryWheelPanel +{ + DECLARE_CLASS_SIMPLE( CVMTPanel, CPotteryWheelPanel ); + +public: + // constructor, destructor + CVMTPanel( vgui::Panel *pParent, const char *pName ); + virtual ~CVMTPanel(); + + // Set the material to draw + void SetMaterial( IMaterial *pMaterial ); + + // Set rendering mode (stretch to full screen, or use actual size) + void RenderUsingActualSize( bool bEnable ); + + // performs the layout + virtual void PerformLayout(); + + virtual void ApplySchemeSettings( vgui::IScheme *pScheme ); + +private: + // paint it stretched to the window size + void DrawStretchedToPanel( CMeshBuilder &meshBuilder ); + + // paint it actual size + void DrawActualSize( CMeshBuilder &meshBuilder ); + + // Draw it on a sphere + void RenderSphere( const Vector &vCenter, float flRadius, int nTheta, int nPhi ); + + // paint it! + virtual void OnPaint3D(); + +private: + // The material to draw + IMaterial *m_pMaterial; + + // A texture to use for a lightmap + CTextureReference m_pLightmapTexture; + + // The default env_cubemap + CTextureReference m_DefaultEnvCubemap; + + // Are we using actual size or not? + bool m_bUseActualSize; + + // Scroll bars + vgui::ScrollBar *m_pHorizontalBar; + vgui::ScrollBar *m_pVerticalBar; + + // The viewable size + int m_iViewableWidth; + int m_iViewableHeight; +}; + +#endif // VMTPANEL_H +
\ No newline at end of file |