Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ACGL
acgl
Commits
e4210c68
Commit
e4210c68
authored
Feb 13, 2013
by
Robert Menzel
Browse files
added getSize to the bufferobject
parent
f96584a2
Changes
1
Hide whitespace changes
Inline
Side-by-side
include/ACGL/OpenGL/Objects/Buffer.hh
View file @
e4210c68
...
...
@@ -58,6 +58,15 @@ public:
glDeleteBuffers
(
1
,
&
mObjectName
);
}
GLuint
mObjectName
;
//! has the side effect of binding this buffer.
//! returned value is in bytes
GLsizei
getSize
(
GLenum
_asTarget
)
{
glBindBuffer
(
_asTarget
,
mObjectName
);
GLint
value
;
glGetBufferParameteriv
(
_asTarget
,
GL_BUFFER_SIZE
,
&
value
);
return
value
;
}
};
typedef
ptr
::
shared_ptr
<
BufferObject
>
SharedBufferObject
;
...
...
@@ -94,10 +103,11 @@ public:
* In this case no GL wrapper calls should ever get called until one gets set!
*/
Buffer
(
SharedBufferObject
_pBuffer
,
GLenum
_target
)
:
mSize
(
0
),
mBuffer
(
_pBuffer
),
:
mBuffer
(
_pBuffer
),
mTarget
(
_target
)
{}
{
mSize
=
mBuffer
->
getSize
(
_target
);
}
virtual
~
Buffer
(){}
...
...
@@ -114,7 +124,7 @@ public:
// ==================================================================================================== \/
//! the GL buffer can get changed at any time
void
setBufferObject
(
SharedBufferObject
_pBuffer
)
{
mBuffer
=
_pBuffer
;
}
void
setBufferObject
(
SharedBufferObject
_pBuffer
)
{
mBuffer
=
_pBuffer
;
mSize
=
mBuffer
->
getSize
(
mTarget
);
}
// ===================================================================================================== \/
// ============================================================================================ WRAPPERS \/
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment