summaryrefslogtreecommitdiff
path: root/vgui2/src/bitmap.h
diff options
context:
space:
mode:
authorFluorescentCIAAfricanAmerican <[email protected]>2020-04-22 12:56:21 -0400
committerFluorescentCIAAfricanAmerican <[email protected]>2020-04-22 12:56:21 -0400
commit3bf9df6b2785fa6d951086978a3e66f49427166a (patch)
tree2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /vgui2/src/bitmap.h
downloadarchived-source-engine-2018-hl2-src-master.tar.xz
archived-source-engine-2018-hl2-src-master.zip
Diffstat (limited to 'vgui2/src/bitmap.h')
-rw-r--r--vgui2/src/bitmap.h64
1 files changed, 64 insertions, 0 deletions
diff --git a/vgui2/src/bitmap.h b/vgui2/src/bitmap.h
new file mode 100644
index 0000000..f75275d
--- /dev/null
+++ b/vgui2/src/bitmap.h
@@ -0,0 +1,64 @@
+//========= Copyright Valve Corporation, All rights reserved. ============//
+//
+// Purpose:
+//
+// $NoKeywords: $
+//=============================================================================//
+
+#ifndef BITMAP_H
+#define BITMAP_H
+
+#ifdef _WIN32
+#pragma once
+#endif
+
+#include <vgui/IImage.h>
+#include <Color.h>
+
+namespace vgui
+{
+
+//-----------------------------------------------------------------------------
+// Purpose: Holds a single image, internal to vgui only
+//-----------------------------------------------------------------------------
+class Bitmap : public IImage
+{
+public:
+ Bitmap( const char *filename, bool hardwareFiltered );
+ ~Bitmap();
+
+ // IImage implementation
+ virtual void Paint();
+ virtual void GetSize( int &wide, int &tall );
+ virtual void GetContentSize( int &wide, int &tall );
+ virtual void SetSize( int x, int y );
+ virtual void SetPos( int x, int y );
+ virtual void SetColor( Color col );
+ virtual bool Evict();
+ virtual int GetNumFrames();
+ virtual void SetFrame( int nFrame );
+ virtual HTexture GetID(); // returns the texture id
+ virtual void SetRotation( int iRotation ) { _rotation = iRotation; }
+
+ // methods
+ void ForceUpload(); // ensures the bitmap has been uploaded
+ const char *GetName();
+ bool IsValid() { return _valid; }
+
+private:
+ HTexture _id;
+ bool _uploaded;
+ bool _valid;
+ char *_filename;
+ int _pos[2];
+ Color _color;
+ bool _filtered;
+ int _wide,_tall;
+ bool _bProcedural;
+ unsigned int nFrameCache;
+ int _rotation;
+};
+
+} // namespace vgui
+
+#endif // BITMAP_H