VR-Forces 4.6 Class Documentation
Home
Modules
Namespaces
Classes
Files
Examples
Behavior Models
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
include
vrvGraphicsUtils
DtGlTexture.h
Go to the documentation of this file.
1
/******************************************************************************
2
** Copyright (c) 2017 MAK Technologies, Inc.
3
** All rights reserved.
4
******************************************************************************/
5
9
#pragma once
10
11
#include <
vrvGraphicsUtils/vrvGraphicsUtils.h
>
12
#include <
vrvGraphicsUtils/DtCommonTypes.h
>
13
#include <
vrvGraphicsUtils/DtDataFormat.h
>
14
#include <
vrvGraphicsUtils/DtUsage.h
>
15
#include <
vrvGraphicsUtils/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
(
const
char
* name,
const
byte
* pData,
size_t
byteLength);
44
46
DtGlTexture
(
const
char
* name,
TextureType
type
47
,
size_t
width,
size_t
height,
size_t
depth
48
,
DtDataFormat
format
49
,
const
DtUsage
usage,
const
DtCpuAccess
cpuAccess,
const
int
bindFlags
50
,
void
* pData);
51
53
DtGlTexture
(
TextureType
type
54
,
size_t
externalRefTexID
55
,
size_t
width = 1,
size_t
height = 1,
size_t
depth = 1);
56
57
void
setName
(
const
char
* name) { myName = name; }
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
void
releaseGLObjects()
const
;
89
90
private
:
91
std::string
myName
;
92
mutable
GLuint
myTextureID
;
93
TextureType
myTextureType
;
94
95
bool
is1D(
void
)
const
;
96
bool
is2D(
void
)
const
;
97
bool
is3D(
void
)
const
;
98
99
size_t
myWidth
;
100
size_t
myHeight
;
101
size_t
myDepth
;
102
DtDataFormat
myFormat
;
103
bool
myExternalTexRef
;
104
};
105
}
Document ID: Generated on Thu Apr 12 03:15:37 EDT 2018 from SVN revision 187986
Copyright © 2005-2018 VT MÄK. All Rights Reserved (
www.mak.com
)