Irrlicht 3D Engine
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
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
15
namespace
irr
16
{
17
namespace
video
18
{
19
20
22
enum
E_TEXTURE_CREATION_FLAG
23
{
32
ETCF_ALWAYS_16_BIT
= 0x00000001,
33
41
ETCF_ALWAYS_32_BIT
= 0x00000002,
42
49
ETCF_OPTIMIZED_FOR_QUALITY
= 0x00000004,
50
56
ETCF_OPTIMIZED_FOR_SPEED
= 0x00000008,
57
59
ETCF_CREATE_MIP_MAPS
= 0x00000010,
60
62
ETCF_NO_ALPHA_CHANNEL
= 0x00000020,
63
65
66
ETCF_ALLOW_NON_POWER_2
= 0x00000040,
67
70
ETCF_FORCE_32_BIT_DO_NOT_USE
= 0x7fffffff
71
};
72
74
enum
E_TEXTURE_LOCK_MODE
75
{
77
ETLM_READ_WRITE
= 0,
78
80
81
ETLM_READ_ONLY
,
82
84
86
ETLM_WRITE_ONLY
87
};
88
90
98
class
ITexture
:
public
virtual
IReferenceCounted
99
{
100
public
:
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
{
171
return
getColorFormat
() ==
video::ECF_A8R8G8B8
||
getColorFormat
() ==
video::ECF_A1R5G5B5
;
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
193
protected
:
194
196
198
inline
E_TEXTURE_CREATION_FLAG
getTextureFormatFromFlags
(
u32
flags)
199
{
200
if
(flags &
ETCF_OPTIMIZED_FOR_SPEED
)
201
return
ETCF_OPTIMIZED_FOR_SPEED
;
202
if
(flags &
ETCF_ALWAYS_16_BIT
)
203
return
ETCF_ALWAYS_16_BIT
;
204
if
(flags &
ETCF_ALWAYS_32_BIT
)
205
return
ETCF_ALWAYS_32_BIT
;
206
if
(flags &
ETCF_OPTIMIZED_FOR_QUALITY
)
207
return
ETCF_OPTIMIZED_FOR_QUALITY
;
208
return
ETCF_OPTIMIZED_FOR_SPEED
;
209
}
210
211
io::SNamedPath
NamedPath
;
212
};
213
214
215
}
// end namespace video
216
}
// end namespace irr
217
218
#endif
219
Irrlicht Engine
Documentation © 2003-2012 by Nikolaus Gebhardt. Generated on Thu Apr 2 2020 05:59:48 for Irrlicht 3D Engine by
Doxygen
1.8.1.2