Crazy Eddies GUI System
0.6.2
Main Page
Related Pages
Namespaces
Classes
Files
File List
RendererModules
directx81GUIRenderer
texture.h
1
/***********************************************************************
2
filename: texture.h
3
created: 10/4/2004
4
author: Paul D Turner
5
6
purpose: Defines concrete texture class
7
*************************************************************************/
8
/***************************************************************************
9
* Copyright (C) 2004 - 2006 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 _texture_h_
31
#define _texture_h_
32
33
#include "CEGUIBase.h"
34
#include "CEGUIRenderer.h"
35
#include "CEGUITexture.h"
36
#include "renderer.h"
37
#include <d3d8.h>
38
#include <list>
39
40
// Start of CEGUI namespace section
41
namespace
CEGUI
42
{
43
48
class
DIRECTX81_GUIRENDERER_API
DirectX81Texture
:
public
Texture
49
{
50
private
:
51
/*************************************************************************
52
Friends (to allow construction and destruction)
53
*************************************************************************/
54
friend
Texture
*
DirectX81Renderer::createTexture
(
void
);
55
friend
Texture
*
DirectX81Renderer::createTexture
(
const
String
& filename,
const
String
& resourceGroup);
56
friend
Texture
*
DirectX81Renderer::createTexture
(
float
size);
57
friend
void
DirectX81Renderer::destroyTexture
(
Texture
* texture);
58
59
60
/*************************************************************************
61
Construction & Destruction (by Renderer object only)
62
*************************************************************************/
63
DirectX81Texture
(
Renderer
* owner);
64
virtual
~
DirectX81Texture
(
void
);
65
66
public
:
74
virtual
ushort
getWidth
(
void
)
const
{
return
d_width;}
75
76
84
virtual
ushort
getHeight
(
void
)
const
{
return
d_height;}
85
86
virtual
ushort
getOriginalWidth
(
void
)
const
{
return
d_orgWidth; }
87
virtual
ushort
getOriginalHeight
(
void
)
const
{
return
d_orgHeight; }
88
102
virtual
void
loadFromFile(
const
String
& filename,
const
String
& resourceGroup);
103
104
124
virtual
void
loadFromMemory(
const
void
* buffPtr, uint buffWidth, uint buffHeight, PixelFormat pixelFormat);
125
126
134
LPDIRECT3DTEXTURE8
getD3DTexture
(
void
)
const
{
return
d_d3dtexture;}
135
136
137
//
148
void
setD3DTextureSize(uint size);
149
150
162
virtual
void
preD3DReset(
void
);
163
164
176
virtual
void
postD3DReset(
void
);
177
178
179
private
:
180
/*************************************************************************
181
Implementation Functions
182
*************************************************************************/
183
// safely free direc3d texture (can be called multiple times with no ill effect)
184
void
freeD3DTexture(
void
);
185
// obtain and fill-in the real texture dimensions.
186
// d_orgWidth and d_orgHeight should be set before calling this, since
187
// they are used as fall-back values if the query fails.
188
void
obtainActualTextureSize(
void
);
189
190
/*************************************************************************
191
Implementation Data
192
*************************************************************************/
193
LPDIRECT3DTEXTURE8 d_d3dtexture;
194
String
d_filename;
195
String
d_resourceGroup;
196
bool
d_isMemoryTexture;
197
198
ushort d_width;
199
ushort d_height;
200
ushort d_orgWidth;
201
ushort d_orgHeight;
202
};
203
204
}
// End of CEGUI namespace section
205
206
207
#endif // end of guard _texture_h_
Generated by
1.8.3.1