Crazy Eddie's GUI System  0.8.1
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
Texture.h
1 /***********************************************************************
2  filename: CEGUITexture.h
3  created: 21/2/2004
4  author: Paul D Turner
5 
6  purpose: Defines abstract interface for texture objects. Texture
7  objects are created & destroyed by the Renderer.
8 *************************************************************************/
9 /***************************************************************************
10  * Copyright (C) 2004 - 2009 Paul D Turner & The CEGUI Development Team
11  *
12  * Permission is hereby granted, free of charge, to any person obtaining
13  * a copy of this software and associated documentation files (the
14  * "Software"), to deal in the Software without restriction, including
15  * without limitation the rights to use, copy, modify, merge, publish,
16  * distribute, sublicense, and/or sell copies of the Software, and to
17  * permit persons to whom the Software is furnished to do so, subject to
18  * the following conditions:
19  *
20  * The above copyright notice and this permission notice shall be
21  * included in all copies or substantial portions of the Software.
22  *
23  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
24  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
25  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
26  * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
27  * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
28  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
29  * OTHER DEALINGS IN THE SOFTWARE.
30  ***************************************************************************/
31 #ifndef _CEGUITexture_h_
32 #define _CEGUITexture_h_
33 
34 #include "CEGUI/Base.h"
35 #include "CEGUI/String.h"
36 #include "CEGUI/Size.h"
37 #include "CEGUI/Vector.h"
38 #include "CEGUI/Rect.h"
39 
40 // Start of CEGUI namespace section
41 namespace CEGUI
42 {
53 class CEGUIEXPORT Texture :
54  public AllocatedObject<Texture>
55 {
56 public:
63  {
83  PF_RGBA_DXT5
84  };
85 
90  virtual ~Texture() {}
91 
99  virtual const String& getName() const = 0;
100 
109  virtual const Sizef& getSize() const = 0;
110 
119  virtual const Sizef& getOriginalDataSize() const = 0;
120 
130  virtual const Vector2f& getTexelScaling() const = 0;
131 
147  virtual void loadFromFile(const String& filename,
148  const String& resourceGroup) = 0;
149 
167  virtual void loadFromMemory(const void* buffer,
168  const Sizef& buffer_size,
169  PixelFormat pixel_format) = 0;
170 
183  virtual void blitFromMemory(const void* sourceData, const Rectf& area) = 0;
184 
195  virtual void blitToMemory(void* targetData) = 0;
196 
219  virtual bool isPixelFormatSupported(const PixelFormat fmt) const = 0;
220 };
221 
222 } // End of CEGUI namespace section
223 
224 #endif // end of guard _CEGUITexture_h_