qxLib
include
qx
gl
vao.h
Go to the documentation of this file.
1
/**
2
3
@file vao.h
4
@author Khrapov
5
@date 19.01.2020
6
@copyright © Nick Khrapov, 2021. All right reserved.
7
8
**/
9
#pragma once
10
11
#include <
qx/gl/ibuffer.h
>
12
#include <
qx/typedefs.h
>
13
14
namespace
qx
15
{
16
17
/**
18
19
@class base_vao
20
@brief Base VAO class
21
@details ~
22
@author Khrapov
23
@date 19.01.2020
24
25
**/
26
class
base_vao
:
IBuffer
27
{
28
public
:
29
base_vao
() =
default
;
30
virtual
~
base_vao
();
31
32
QX_DECL_IBUFFER
33
34
/**
35
@brief Enable a generic vertex attribute array
36
@param nIndex - array index in VAO
37
**/
38
void
EnableVertexArrtibArray
(
size_t
nIndex);
39
40
/**
41
@brief Disable a generic vertex attribute array
42
@param nIndex - array index in VAO
43
**/
44
void
DisableVertexArrtibArray
(
size_t
nIndex);
45
46
/**
47
@brief Define an array of generic vertex attribute data
48
@param nIndex - index of the generic vertex attribute to be modified
49
@param nSize - number of components per generic vertex attribute.
50
Must be 1, 2, 3, 4
51
@param eType - data type of each component in the array
52
@param bNormalized - specifies whether fixed-point data values should be
53
normalized or converted directly as fixed-point values
54
@param nStride - byte offset between consecutive generic vertex attributes
55
@param nOffset - offset of the first component of the first generic
56
vertex attribute in the array in the data store of
57
the buffer currently bound to the GL_ARRAY_BUFFER target
58
**/
59
void
VertexAttribPointer
(
60
size_t
nIndex,
61
GLint nSize,
62
GLenum eType,
63
GLboolean bNormalized,
64
GLsizei nStride,
65
size_t
nOffset);
66
67
private
:
68
GLuint m_nVAO = std::numeric_limits<GLuint>::max();
69
};
70
71
using
vao
=
base_vao
;
72
73
}
// namespace qx
74
75
#include <
qx/gl/vao.inl
>
qx::IBuffer
OpenGL buffer interface.
Definition:
ibuffer.h:26
qx::base_vao
Base VAO class.
Definition:
vao.h:27
qx::base_vao::EnableVertexArrtibArray
QX_DECL_IBUFFER void EnableVertexArrtibArray(size_t nIndex)
Enable a generic vertex attribute array.
Definition:
vao.inl:47
qx::base_vao::DisableVertexArrtibArray
void DisableVertexArrtibArray(size_t nIndex)
Disable a generic vertex attribute array.
Definition:
vao.inl:52
qx::base_vao::VertexAttribPointer
void VertexAttribPointer(size_t nIndex, GLint nSize, GLenum eType, GLboolean bNormalized, GLsizei nStride, size_t nOffset)
Define an array of generic vertex attribute data.
Definition:
vao.inl:57
ibuffer.h
typedefs.h
vao.inl
Generated by
1.9.1