Crazy Eddie's GUI System  0.8.7
Texture.h
1 /***********************************************************************
2  created: 21/2/2004
3  author: Paul D Turner
4 
5  purpose: Defines abstract interface for texture objects. Texture
6  objects are created & destroyed by the Renderer.
7 *************************************************************************/
8 /***************************************************************************
9  * Copyright (C) 2004 - 2009 Paul D Turner & The CEGUI Development Team
10  *
11  * Permission is hereby granted, free of charge, to any person obtaining
12  * a copy of this software and associated documentation files (the
13  * "Software"), to deal in the Software without restriction, including
14  * without limitation the rights to use, copy, modify, merge, publish,
15  * distribute, sublicense, and/or sell copies of the Software, and to
16  * permit persons to whom the Software is furnished to do so, subject to
17  * the following conditions:
18  *
19  * The above copyright notice and this permission notice shall be
20  * included in all copies or substantial portions of the Software.
21  *
22  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
23  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
24  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
25  * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
26  * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
27  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
28  * OTHER DEALINGS IN THE SOFTWARE.
29  ***************************************************************************/
30 #ifndef _CEGUITexture_h_
31 #define _CEGUITexture_h_
32 
33 #include "CEGUI/Base.h"
34 #include "CEGUI/String.h"
35 #include "CEGUI/Size.h"
36 #include "CEGUI/Vector.h"
37 #include "CEGUI/Rect.h"
38 
39 // Start of CEGUI namespace section
40 namespace CEGUI
41 {
52 class CEGUIEXPORT Texture :
53  public AllocatedObject<Texture>
54 {
55 public:
62  {
82  PF_RGBA_DXT5
83  };
84 
89  virtual ~Texture() {}
90 
98  virtual const String& getName() const = 0;
99 
108  virtual const Sizef& getSize() const = 0;
109 
118  virtual const Sizef& getOriginalDataSize() const = 0;
119 
129  virtual const Vector2f& getTexelScaling() const = 0;
130 
146  virtual void loadFromFile(const String& filename,
147  const String& resourceGroup) = 0;
148 
166  virtual void loadFromMemory(const void* buffer,
167  const Sizef& buffer_size,
168  PixelFormat pixel_format) = 0;
169 
182  virtual void blitFromMemory(const void* sourceData, const Rectf& area) = 0;
183 
194  virtual void blitToMemory(void* targetData) = 0;
195 
218  virtual bool isPixelFormatSupported(const PixelFormat fmt) const = 0;
219 };
220 
221 } // End of CEGUI namespace section
222 
223 #endif // end of guard _CEGUITexture_h_
PixelFormat
Enumerated type containing the supported pixel formats that can be passed to loadFromMemory.
Definition: Texture.h:61
Definition: MemoryAllocatedObject.h:109
Main namespace for Crazy Eddie's GUI Library.
Definition: arch_overview.dox:1
Each pixel is 4 bytes. RGBA in that order.
Definition: Texture.h:66
Each pixel is 2 bytes. RGBA in that order.
Definition: Texture.h:68
S3 DXT1 texture compression (RGBA).
Definition: Texture.h:80
Each pixel is 3 bytes. RGB in that order.
Definition: Texture.h:64
Abstract base class specifying the required interface for Texture objects.
Definition: Texture.h:52
virtual ~Texture()
Destructor for Texture base class.
Definition: Texture.h:89
S3 DXT1 texture compression (RGBA).
Definition: Texture.h:78
S3 DXT1 texture compression (RGB).
Definition: Texture.h:76
Each pixel is 2 bytes. RGB in that order.
Definition: Texture.h:70
PVR texture compression. Each pixel is 2 bits.
Definition: Texture.h:72
PVR texture compression. Each pixel is 4 bits.
Definition: Texture.h:74
String class used within the GUI system.
Definition: String.h:62