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.

59 lines
847 B

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================//
  6. #ifndef HUDTEXTUREHANDLE_H
  7. #define HUDTEXTUREHANDLE_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. class CHudTexture;
  12. class CHudTextureHandle
  13. {
  14. public:
  15. CHudTextureHandle()
  16. {
  17. m_pValue = NULL;
  18. }
  19. // Assign a value to the handle.
  20. const CHudTextureHandle& operator=( const CHudTexture *t )
  21. {
  22. m_pValue = (CHudTexture *)t;
  23. return *this;
  24. }
  25. void Set( CHudTexture *t )
  26. {
  27. m_pValue = t;
  28. }
  29. CHudTexture *Get()
  30. {
  31. return m_pValue;
  32. }
  33. operator CHudTexture*()
  34. {
  35. return m_pValue;
  36. }
  37. operator CHudTexture*() const
  38. {
  39. return m_pValue;
  40. }
  41. CHudTexture *operator->() const
  42. {
  43. return m_pValue;
  44. }
  45. private:
  46. CHudTexture *m_pValue;
  47. };
  48. #endif // HUDTEXTUREHANDLE_H