VR-Forces 5.0.2 Developer's Guide
Home
Modules
Namespaces
Classes
Files
Examples
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
include
vrvOsg
DtBufferObjectApplyAttribute.h
Go to the documentation of this file.
1
/******************************************************************************
2
** Copyright (c) 2022 MAK Technologies, Inc.
3
** All rights reserved.
4
******************************************************************************/
5
9
10
#pragma once
11
12
#include <
vrvOsg/vrvOsg.h
>
13
14
#include <osg/StateAttribute>
15
16
#include <unordered_map>
17
#include <map>
18
19
namespace
osg
20
{
21
class
State;
22
}
23
24
namespace
makVrv
25
{
26
class
DtGlBuffer;
27
28
class
DtBufferObjectApplyAttribute;
29
31
class
DtBufferObjectApplyAttributeCallback
32
{
33
public
:
34
virtual
void
callback
(
const
DtBufferObjectApplyAttribute
* attribute,
const
osg::State& state) = 0;
35
};
36
39
class
DT_DLL_VRVOSG
DtBufferObjectApplyAttribute
:
public
osg::StateAttribute
40
{
41
public
:
43
DtBufferObjectApplyAttribute
();
44
46
DtBufferObjectApplyAttribute
(
const
DtBufferObjectApplyAttribute
& copy,
const
osg::CopyOp& copyOp =
47
osg::CopyOp::SHALLOW_COPY);
48
50
virtual
~
DtBufferObjectApplyAttribute
();
51
52
private
:
55
DtBufferObjectApplyAttribute
& operator=(
const
DtBufferObjectApplyAttribute
&) =
delete
;
56
57
public
:
59
virtual
void
addBufferObject(
DtGlBuffer
* ubo,
GLuint
bindingPointIndex);
60
62
virtual
void
removeBufferObject(
DtGlBuffer
* ubo);
63
65
virtual
void
apply(osg::State& state)
const
;
66
68
virtual
int
compare(
const
StateAttribute& sa)
const
= 0;
69
71
virtual
void
releaseGLObjects(osg::State* state
/* =0 */
)
const
;
72
74
virtual
void
setCallback(
DtBufferObjectApplyAttributeCallback
* callback);
75
76
protected
:
77
typedef
std::map<GLuint, DtGlBuffer*>
BufferMap
;
78
BufferMap
myBufferMap
;
79
80
DtBufferObjectApplyAttributeCallback
* myCallback =
nullptr
;
81
82
bool
myConsecutive =
false
;
83
mutable
std::vector<unsigned int>
myConsecutiveHandlesScratch
;
84
};
85
}
makVrv::DtBufferObjectApplyAttributeCallback
callback just before the attribute is applied
Definition:
DtBufferObjectApplyAttribute.h:31
DT_DLL_VRVOSG
#define DT_DLL_VRVOSG
Definition:
vrvOsg.h:23
GLuint
unsigned int GLuint
Definition:
DtGlTextureBufferObject.h:17
makVrv::DtBufferObjectApplyAttributeCallback::callback
virtual void callback(const DtBufferObjectApplyAttribute *attribute, const osg::State &state)=0
makVrv::DtBufferObjectApplyAttribute::myConsecutiveHandlesScratch
std::vector< unsigned int > myConsecutiveHandlesScratch
Definition:
DtBufferObjectApplyAttribute.h:83
makVrv::DtBufferObjectApplyAttribute::BufferMap
std::map< GLuint, DtGlBuffer * > BufferMap
Definition:
DtBufferObjectApplyAttribute.h:77
makVrv::DtGlBuffer
A generic OpenGL buffer. This can be: -> a vertex buffer -> an index buffer -> a shader storage buffe...
Definition:
DtGlBuffer.h:29
makVrv::DtBufferObjectApplyAttribute
Manage buffer object binding state, via glBindBufferBase.
Definition:
DtBufferObjectApplyAttribute.h:39
vrvOsg.h
Contains DLL export macros.
makVrv::DtBufferObjectApplyAttribute::myBufferMap
BufferMap myBufferMap
Definition:
DtBufferObjectApplyAttribute.h:78
Document ID: Generated on Sun Dec 4 20:22:03 EST 2022 from SVN revision 249613
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (
www.mak.com
)