Crazy Eddie's GUI System
0.8.4
|
00001 /*********************************************************************** 00002 created: 21/2/2004 00003 author: Paul D Turner 00004 00005 purpose: Defines abstract interface for texture objects. Texture 00006 objects are created & destroyed by the Renderer. 00007 *************************************************************************/ 00008 /*************************************************************************** 00009 * Copyright (C) 2004 - 2009 Paul D Turner & The CEGUI Development Team 00010 * 00011 * Permission is hereby granted, free of charge, to any person obtaining 00012 * a copy of this software and associated documentation files (the 00013 * "Software"), to deal in the Software without restriction, including 00014 * without limitation the rights to use, copy, modify, merge, publish, 00015 * distribute, sublicense, and/or sell copies of the Software, and to 00016 * permit persons to whom the Software is furnished to do so, subject to 00017 * the following conditions: 00018 * 00019 * The above copyright notice and this permission notice shall be 00020 * included in all copies or substantial portions of the Software. 00021 * 00022 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 00023 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 00024 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 00025 * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR 00026 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 00027 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 00028 * OTHER DEALINGS IN THE SOFTWARE. 00029 ***************************************************************************/ 00030 #ifndef _CEGUITexture_h_ 00031 #define _CEGUITexture_h_ 00032 00033 #include "CEGUI/Base.h" 00034 #include "CEGUI/String.h" 00035 #include "CEGUI/Size.h" 00036 #include "CEGUI/Vector.h" 00037 #include "CEGUI/Rect.h" 00038 00039 // Start of CEGUI namespace section 00040 namespace CEGUI 00041 { 00052 class CEGUIEXPORT Texture : 00053 public AllocatedObject<Texture> 00054 { 00055 public: 00061 enum PixelFormat 00062 { 00064 PF_RGB, 00066 PF_RGBA, 00068 PF_RGBA_4444, 00070 PF_RGB_565, 00072 PF_PVRTC2, 00074 PF_PVRTC4, 00076 PF_RGB_DXT1, 00078 PF_RGBA_DXT1, 00080 PF_RGBA_DXT3, 00082 PF_RGBA_DXT5 00083 }; 00084 00089 virtual ~Texture() {} 00090 00098 virtual const String& getName() const = 0; 00099 00108 virtual const Sizef& getSize() const = 0; 00109 00118 virtual const Sizef& getOriginalDataSize() const = 0; 00119 00129 virtual const Vector2f& getTexelScaling() const = 0; 00130 00146 virtual void loadFromFile(const String& filename, 00147 const String& resourceGroup) = 0; 00148 00166 virtual void loadFromMemory(const void* buffer, 00167 const Sizef& buffer_size, 00168 PixelFormat pixel_format) = 0; 00169 00182 virtual void blitFromMemory(const void* sourceData, const Rectf& area) = 0; 00183 00194 virtual void blitToMemory(void* targetData) = 0; 00195 00218 virtual bool isPixelFormatSupported(const PixelFormat fmt) const = 0; 00219 }; 00220 00221 } // End of CEGUI namespace section 00222 00223 #endif // end of guard _CEGUITexture_h_