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.

61 lines
1.6 KiB

  1. //========= Copyright � 1996-2009, Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. //=====================================================================================//
  6. #ifndef __SCALEFORMUIIMAGE_H__
  7. #define __SCALEFORMUIIMAGE_H__
  8. #include "tier1/utlbuffer.h"
  9. #include "bitmap/imageformat_declarations.h"
  10. //-----------------------------------------------------------------------------
  11. // Purpose:
  12. //-----------------------------------------------------------------------------
  13. class ScaleformUIImage
  14. {
  15. public:
  16. ScaleformUIImage( const byte* defaultRgba, int defaultWidth, int defaultHeight, ::ImageFormat defaultFormat, SF::GFx::TextureManager* pTextureManager );
  17. virtual ~ScaleformUIImage( void );
  18. // Tick any loading task that needs to be updated
  19. virtual void Update( void );
  20. virtual int GetWidth( void ) const { return m_nWidth; }
  21. virtual int GetHeight( void ) const { return m_nHeight; }
  22. virtual SF::Render::Image* GetImage( void );
  23. virtual int AddRef()
  24. {
  25. return ThreadInterlockedIncrement( &m_nRefCount );
  26. }
  27. virtual int Release()
  28. {
  29. int refCount = ThreadInterlockedDecrement( &m_nRefCount );
  30. if ( refCount == 0 )
  31. {
  32. OnFinalRelease();
  33. }
  34. return refCount;
  35. }
  36. virtual void OnFinalRelease();
  37. protected:
  38. SF::Render::ImageFormat ConvertImageFormat( ::ImageFormat format );
  39. virtual void InitFromBuffer( const byte *rgba, int width, int height, ::ImageFormat format );
  40. volatile int32 m_nRefCount;
  41. int m_nWidth;
  42. int m_nHeight;
  43. ImageFormat m_format;
  44. SF::GFx::ImageDelegate* m_pImage;
  45. SF::GFx::TextureManager* m_pTextureManager;
  46. };
  47. #endif // __SCALEFORMUIIMAGE_H__