Home | Namespaces | Hierarchy | Alphabetical List | Class list | Files | Namespace Members | Class members | File members | Tutorials
ITexture.h
Go to the documentation of this file.
1 // Copyright (C) 2002-2010 Nikolaus Gebhardt
2 // This file is part of the "Irrlicht Engine".
3 // For conditions of distribution and use, see copyright notice in irrlicht.h
4 
5 #ifndef __I_TEXTURE_H_INCLUDED__
6 #define __I_TEXTURE_H_INCLUDED__
7 
8 #include "IReferenceCounted.h"
9 #include "IImage.h"
10 #include "dimension2d.h"
11 #include "EDriverTypes.h"
12 #include "path.h"
13 #include "matrix4.h"
14 
15 namespace irr
16 {
17 namespace video
18 {
19 
20 
23 {
32  ETCF_ALWAYS_16_BIT = 0x00000001,
33 
41  ETCF_ALWAYS_32_BIT = 0x00000002,
42 
50 
57 
59  ETCF_CREATE_MIP_MAPS = 0x00000010,
60 
62  ETCF_NO_ALPHA_CHANNEL = 0x00000020,
63 
65 
66  ETCF_ALLOW_NON_POWER_2 = 0x00000040,
67 
71 };
72 
73 
75 
83 class ITexture : public virtual IReferenceCounted
84 {
85 public:
86 
88  ITexture(const io::path& name) : NamedPath(name)
89  {
90  }
91 
93 
105  virtual void* lock(bool readOnly = false, u32 mipmapLevel=0) = 0;
106 
108 
109  virtual void unlock() = 0;
110 
112 
119  virtual const core::dimension2d<u32>& getOriginalSize() const = 0;
120 
122 
123  virtual const core::dimension2d<u32>& getSize() const = 0;
124 
126 
130  virtual E_DRIVER_TYPE getDriverType() const = 0;
131 
133 
134  virtual ECOLOR_FORMAT getColorFormat() const = 0;
135 
137 
140  virtual u32 getPitch() const = 0;
141 
143 
144  virtual bool hasMipMaps() const { return false; }
145 
147  virtual bool hasAlpha() const {
149  }
150 
152 
153  virtual void regenerateMipMapLevels(void* mipmapData=0) = 0;
154 
156 
157  virtual bool isRenderTarget() const { return false; }
158 
160  const io::SNamedPath& getName() const { return NamedPath; }
161 
162 protected:
163 
165 
168  {
169  if (flags & ETCF_OPTIMIZED_FOR_SPEED)
171  if (flags & ETCF_ALWAYS_16_BIT)
172  return ETCF_ALWAYS_16_BIT;
173  if (flags & ETCF_ALWAYS_32_BIT)
174  return ETCF_ALWAYS_32_BIT;
175  if (flags & ETCF_OPTIMIZED_FOR_QUALITY)
178  }
179 
181 };
182 
183 
184 } // end namespace video
185 } // end namespace irr
186 
187 #endif
188 

The Irrlicht Engine
The Irrlicht Engine Documentation © 2003-2010 by Nikolaus Gebhardt. Generated on Fri Mar 21 2014 04:40:17 by Doxygen (1.8.1.2)