Irrlicht 3D Engine
 
Loading...
Searching...
No Matches
ITexture.h
Go to the documentation of this file.
1// Copyright (C) 2002-2012 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
15namespace irr
16{
17namespace video
18{
19
20
23{
32 ETCF_ALWAYS_16_BIT = 0x00000001,
33
41 ETCF_ALWAYS_32_BIT = 0x00000002,
42
50
57
60
63
65
67
71};
72
88
90
98class ITexture : public virtual IReferenceCounted
99{
100public:
101
103 ITexture(const io::path& name) : NamedPath(name)
104 {
105 }
106
108
127 virtual void* lock(E_TEXTURE_LOCK_MODE mode=ETLM_READ_WRITE, u32 mipmapLevel=0) = 0;
128
130
132 virtual void unlock() = 0;
133
135
142 virtual const core::dimension2d<u32>& getOriginalSize() const = 0;
143
145
146 virtual const core::dimension2d<u32>& getSize() const = 0;
147
149
153 virtual E_DRIVER_TYPE getDriverType() const = 0;
154
156
157 virtual ECOLOR_FORMAT getColorFormat() const = 0;
158
160
163 virtual u32 getPitch() const = 0;
164
166
167 virtual bool hasMipMaps() const { return false; }
168
170 virtual bool hasAlpha() const {
172 }
173
175
181 virtual void regenerateMipMapLevels(void* mipmapData=0) = 0;
182
184
188 virtual bool isRenderTarget() const { return false; }
189
191 const io::SNamedPath& getName() const { return NamedPath; }
192
193protected:
194
196
210
212};
213
214
215} // end namespace video
216} // end namespace irr
217
218#endif
219
Base class of most objects of the Irrlicht Engine.
Axis aligned bounding box in 3d dimensional space.
Definition aabbox3d.h:22
Interface of a Video Driver dependent Texture.
Definition ITexture.h:99
virtual u32 getPitch() const =0
Get pitch of the main texture (in bytes).
virtual void unlock()=0
Unlock function. Must be called after a lock() to the texture.
virtual const core::dimension2d< u32 > & getOriginalSize() const =0
Get original size of the texture.
ITexture(const io::path &name)
constructor
Definition ITexture.h:103
virtual const core::dimension2d< u32 > & getSize() const =0
Get dimension (=size) of the texture.
virtual ECOLOR_FORMAT getColorFormat() const =0
Get the color format of texture.
virtual E_DRIVER_TYPE getDriverType() const =0
Get driver type of texture.
virtual void * lock(E_TEXTURE_LOCK_MODE mode=ETLM_READ_WRITE, u32 mipmapLevel=0)=0
Lock function.
virtual bool hasAlpha() const
Returns if the texture has an alpha channel.
Definition ITexture.h:170
virtual void regenerateMipMapLevels(void *mipmapData=0)=0
Regenerates the mip map levels of the texture.
virtual bool hasMipMaps() const
Check whether the texture has MipMaps.
Definition ITexture.h:167
virtual bool isRenderTarget() const
Check whether the texture is a render target.
Definition ITexture.h:188
io::SNamedPath NamedPath
Definition ITexture.h:211
const io::SNamedPath & getName() const
Get name of texture (in most cases this is the filename)
Definition ITexture.h:191
E_TEXTURE_CREATION_FLAG getTextureFormatFromFlags(u32 flags)
Helper function, helps to get the desired texture creation format from the flags.
Definition ITexture.h:198
ECOLOR_FORMAT
An enum for the color format of textures used by the Irrlicht Engine.
Definition SColor.h:18
@ ECF_A1R5G5B5
16 bit color format used by the software driver.
Definition SColor.h:23
@ ECF_A8R8G8B8
Default 32 bit color format. 8 bits are used for every component: red, green, blue and alpha.
Definition SColor.h:32
E_TEXTURE_LOCK_MODE
Enum for the mode for texture locking. Read-Only, write-only or read/write.
Definition ITexture.h:75
@ ETLM_READ_ONLY
Read only. The texture is downloaded, but not uploaded again.
Definition ITexture.h:81
@ ETLM_READ_WRITE
The default mode. Texture can be read and written to.
Definition ITexture.h:77
@ ETLM_WRITE_ONLY
Write only. The texture is not downloaded and might be uninitialised.
Definition ITexture.h:86
E_TEXTURE_CREATION_FLAG
Enumeration flags telling the video driver in which format textures should be created.
Definition ITexture.h:23
@ ETCF_FORCE_32_BIT_DO_NOT_USE
Definition ITexture.h:70
@ ETCF_OPTIMIZED_FOR_SPEED
Definition ITexture.h:56
@ ETCF_ALWAYS_32_BIT
Definition ITexture.h:41
@ ETCF_CREATE_MIP_MAPS
Definition ITexture.h:59
@ ETCF_ALWAYS_16_BIT
Definition ITexture.h:32
@ ETCF_ALLOW_NON_POWER_2
Allow the Driver to use Non-Power-2-Textures.
Definition ITexture.h:66
@ ETCF_NO_ALPHA_CHANNEL
Definition ITexture.h:62
@ ETCF_OPTIMIZED_FOR_QUALITY
Definition ITexture.h:49
E_DRIVER_TYPE
An enum for all types of drivers the Irrlicht Engine supports.
Everything in the Irrlicht Engine can be found in this namespace.
Definition aabbox3d.h:13
unsigned int u32
32 bit unsigned variable.
Definition irrTypes.h:58
Used in places where we identify objects by a filename, but don't actually work with the real filenam...
Definition path.h:24