VR-Forces 4.7 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
DtGlTextureBufferObject.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/DtDataFormat.h
>
13
#include <
vrvGraphicsUtils/DtCommonTypes.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
25
class
DT_DLL_VRVGRAPHICSUTILS
DtGlTextureBufferObject
26
{
27
public
:
29
//ONLY SAFE IN THE DRAW THREAD
30
DtGlTextureBufferObject
(
const
char
* name,
size_t
sizeInBytes
31
,
DtDataFormat
format
32
,
DtUsage
usage
33
,
DtCpuAccess
cpuAccess);
34
35
// doesn't allocate instantly
36
DtGlTextureBufferObject
(
37
const
char
* name,
38
DtDataFormat
format
39
,
DtUsage
usage
40
,
DtCpuAccess
cpuAccess
41
);
42
43
void
setName
(
const
char
* name) { myName = name; }
44
46
virtual
~
DtGlTextureBufferObject
();
47
49
size_t
sizeInBytes(
void
)
const
;
50
52
void
copyData(
void
* pData,
size_t
sizeInBytes,
size_t
offsetInBytes = 0);
53
55
void
copyDataMapped(
void
* pData,
size_t
sizeInBytes,
size_t
offsetInBytes = 0);
56
58
DtDataFormat
format
(
void
)
const
{
return
myFormat; }
59
60
void
bindTexture(
void
);
61
void
bindTBO(
void
);
62
void
* mapTBO(
void
);
63
void
unmapTBO(
void
);
64
66
void
resize(
size_t
sizeInBytes);
67
68
void
tearDown(
void
);
69
void
setUseBufferedData
(
bool
val) { myUseBufferData = val; }
70
bool
getUseBufferedData
() {
return
myUseBufferData; }
71
72
private
:
73
std::string
myName
;
74
GLuint
myTextureBufferObjectID
;
75
GLuint
myTextureID
;
76
size_t
mySizeInBytes
;
77
78
DtUsage
myUsage
;
79
DtCpuAccess
myCPUAccess
;
80
DtDataFormat
myFormat
;
81
82
GLenum
myGLUsage
;
83
GLenum
myGLInternalFormat
;
84
85
bool
myUseBufferData
;
86
char
*
myBufferData
;
87
88
void
reInitialize(
const
byte
* pData);
89
};
90
}
Document ID: Generated on Fri Apr 26 21:53:14 EDT 2019 from SVN revision 197883
Copyright © 2005-2019 VT MAK. All Rights Reserved (
www.mak.com
)