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
DtGlBuffer.h
Go to the documentation of this file.
1
/******************************************************************************
2
** Copyright (c) 2018 VT-MAK Technologies, Inc.
3
** All rights reserved.
4
******************************************************************************/
5
9
#pragma once
10
#include <
vrvGraphicsUtils/vrvGraphicsUtils.h
>
11
#include <
vrvGraphicsUtils/DtBufferType.h
>
12
#include <
vrvGraphicsUtils/DtUsage.h
>
13
#include <
vrvGraphicsUtils/DtCpuAccess.h
>
14
#include <GL/glew.h>
15
#include <string>
16
17
namespace
makVrv
18
{
24
class
DT_DLL_VRVGRAPHICSUTILS
DtGlBuffer
25
{
26
public
:
34
DtGlBuffer
(
const
char
* name,
DtBufferType
type,
int
sizeInBytes,
DtUsage
usage,
DtCpuAccess
accessType,
bool
hasStagingBuffer,
const
GLvoid* data = 0);
35
37
virtual
~
DtGlBuffer
();
38
41
virtual
void
resizeBuffer(
int
sizeInBytes,
const
GLvoid* data);
42
44
45
void
bind
();
46
void
unbind();
48
50
51
52
53
void
bind
(GLenum type);
54
void
unbind(GLenum type);
56
58
int
sizeInBytes(
void
)
const
;
59
61
GLenum type(
void
)
const
;
62
64
65
66
67
68
69
GLubyte* findStagingBuffer(
void
)
const
;
70
73
void
syncToGpu(GLuint
offset
, GLuint sizeInBytes);
74
77
void
syncToGpu();
79
84
void
bufferSubData(GLuint offset, GLuint sizeInBytes,
const
GLvoid *data);
85
87
GLuint handle(
void
)
const
;
88
89
void
tearDown(
void
)
const
;
90
97
static
bool
resizeBufferIfNecessary(
DtGlBuffer
*& buffer,
const
char
* name,
98
DtBufferType
bufferType,
int
sizeInBytesNeeded,
DtUsage
usage,
DtCpuAccess
accessType,
bool
hasStaging,
const
void
* data);
99
100
protected
:
101
std::string
myName
;
102
mutable
GLuint
myHandle
;
103
GLenum
myType
;
104
int
mySizeInBytes
;
105
106
GLubyte*
myStagingBufffer
;
107
bool
myHasStagingBuffer
;
108
DtUsage
myUsage
;
109
DtCpuAccess
myAccessType
;
110
};
111
}
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
)