VR-Forces Development_Version Class Documentation
Home
Modules
Namespaces
Classes
Files
Examples
Behavior Models
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
include
vrvGraphicsUtils
DtGLTexture.h
Go to the documentation of this file.
1
/******************************************************************************
2
** Copyright (c) 2014 MAK Technologies, Inc.
3
** All rights reserved.
4
******************************************************************************/
5
9
#pragma once
10
11
#include "
DtGraphicsUtilsPreReqs.h
"
12
#include "
DtCommonTypes.h
"
13
#include "
DtDataFormat.h
"
14
#include "
DtUsage.h
"
15
#include "
DtCPUAccess.h
"
16
17
#include <GL/glew.h>
18
19
namespace
makVrv {
20
21
class
Device;
22
23
enum
TextureType
24
{
25
// 1D texture, used in combination with 1D texture coordinates
26
TEX_TYPE_1D
= 1,
27
// 2D texture, used in combination with 2D texture coordinates (default)
28
TEX_TYPE_2D
= 2,
29
// 3D volume texture, used in combination with 3D texture coordinates
30
TEX_TYPE_3D
= 3,
31
// 3D cube map, used in combination with 3D texture coordinates
32
TEX_TYPE_CUBE_MAP
= 4,
33
// 2D texture array
34
TEX_TYPE_2D_ARRAY
= 5
35
};
36
39
class
DT_DLL_VRVGRAPHICSUTILS
DtGLTexture
40
{
41
public
:
43
DtGLTexture
(Device* pDevice,
const
byte
* pData,
size_t
byteLength);
44
46
DtGLTexture
(Device* pDevice
47
,
TextureType
type
48
,
size_t
width,
size_t
height,
size_t
depth
49
,
DtDataFormat
format
50
,
const
DtUsage
usage,
const
DtCpuAccess
cpuAccess,
const
int
bindFlags
51
,
void
* pData);
52
54
DtGLTexture
(Device* pDevice
55
,
TextureType
type
56
,
size_t
externalRefTexID
57
,
size_t
width = 1,
size_t
height = 1,
size_t
depth = 1);
58
60
virtual
~
DtGLTexture
();
61
63
DtDataFormat
format(
void
)
const
;
64
66
size_t
sizeInBytes(
void
)
const
;
67
69
size_t
width(
void
)
const
;
71
size_t
height(
void
)
const
;
73
size_t
depth(
void
)
const
;
74
76
void
copyData(
void
* pData);
77
80
void
copyData(
void
* pData,
size_t
width,
size_t
height,
size_t
depth);
81
82
void
bindTexture(
void
);
83
84
void
setExternalTextureReference(
size_t
externalRefTexID);
85
86
size_t
textureReference()
const
;
87
88
private
:
89
90
GLuint
myTextureID
;
91
TextureType
myTextureType
;
92
93
bool
is1D(
void
)
const
;
94
bool
is2D(
void
)
const
;
95
bool
is3D(
void
)
const
;
96
97
size_t
myWidth
;
98
size_t
myHeight
;
99
size_t
myDepth
;
100
DtDataFormat
myFormat
;
101
bool
myExternalTexRef
;
102
};
103
}
Document ID: Generated on Tue Mar 8 22:13:38 EST 2016 from SVN revision 162938
Copyright © 2005-2015 VT MÄK. All Rights Reserved (
www.mak.com
)