YourGameLib
Loading...
Searching...
No Matches
include
toolbox
yourgame
gl
buffer.h
Go to the documentation of this file.
1
/*
2
Copyright (c) 2019-2024 Alexander Scholz
3
4
This software is provided 'as-is', without any express or implied
5
warranty. In no event will the authors be held liable for any damages
6
arising from the use of this software.
7
8
Permission is granted to anyone to use this software for any purpose,
9
including commercial applications, and to alter it and redistribute it
10
freely, subject to the following restrictions:
11
12
1. The origin of this software must not be misrepresented; you must not
13
claim that you wrote the original software. If you use this software
14
in a product, an acknowledgment in the product documentation would be
15
appreciated but is not required.
16
2. Altered source versions must be plainly marked as such, and must not be
17
misrepresented as being the original software.
18
3. This notice may not be removed or altered from any source distribution.
19
*/
20
#ifndef YOURGAME_GLBUFFER_H
21
#define YOURGAME_GLBUFFER_H
22
23
#include "
yourgame/gl_include.h
"
24
25
namespace
yourgame
26
{
27
namespace
gl
28
{
29
class
Buffer
30
{
31
public
:
32
static
Buffer
*
make
(GLenum target, GLsizeiptr size,
const
GLvoid *data, GLenum usage);
33
~Buffer
();
34
void
bind
();
35
void
unbindTarget
();
36
bool
bufferData
(GLsizeiptr size,
const
GLvoid *data);
37
38
/* deleting the copy constructor and the copy assignment operator
39
prevents copying (and moving) of the object. */
40
Buffer
(
Buffer
const
&) =
delete
;
41
Buffer
&
operator=
(
Buffer
const
&) =
delete
;
42
43
private
:
44
Buffer
() {}
45
GLenum m_target;
46
GLuint m_handle;
47
GLenum m_usage;
48
};
49
}
// namespace gl
50
}
// namespace yourgame
51
52
#endif
yourgame::gl::Buffer
Definition
buffer.h:30
yourgame::gl::Buffer::bufferData
bool bufferData(GLsizeiptr size, const GLvoid *data)
Definition
buffer.cpp:67
yourgame::gl::Buffer::bind
void bind()
Definition
buffer.cpp:57
yourgame::gl::Buffer::Buffer
Buffer(Buffer const &)=delete
yourgame::gl::Buffer::~Buffer
~Buffer()
Definition
buffer.cpp:52
yourgame::gl::Buffer::make
static Buffer * make(GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage)
Definition
buffer.cpp:27
yourgame::gl::Buffer::unbindTarget
void unbindTarget()
Definition
buffer.cpp:62
yourgame::gl::Buffer::operator=
Buffer & operator=(Buffer const &)=delete
gl_include.h
yourgame
Definition
audio.h:27
Generated by
1.9.8