sculpto
gl_vertex_array.h
Go to the documentation of this file.
1/*!****************************************************************//*!*
2 * \file mesh.h
3 * \brief OpenGL mesh (vertex_array) class definition module.
4 * Mesh stores vertex and index buffer and implement their binding during render.
5 *
6 * \author Sabitov Kirill
7 * \date 27 June 2022
8 *********************************************************************/
9
10#pragma once
11
12#include "gl.h"
14
15namespace scl
16{
19 {
20 private:
21 GLuint Id {};
22
23 /*!*
24 * Convert abstract shader variable type to OpenGL specific.
25 *
26 * \param Type - shader variable type to convert to OpenGL specific.
27 * \return OpenGL specific shader variable type.
28 */
29 inline constexpr static GLenum GetGLShaderVariableType(shader_variable_type Type);
30
31 public:
33 render_primitive::handle GetHandle() const override { return Id; }
34
39
40 /*!*
41 * Vertex buffer default constructor.
42 *
43 * \param Type - creating mesh type.
44 * \param VertexBuffer - vertex buffer to be linked to vertex array.
45 * \param IndexBuffer - index array to be linked to vertex array.
46 */
47 gl_vertex_array(mesh_type MeshType);
48
51
52 /*!*
53 * Bind vertex array to current render stage function.
54 *
55 * \param None.
56 * \return None.
57 */
58 void Bind() const override;
59
60 /*!*
61 * Unbind vertex array from current render stage function.
62 *
63 * \param None.
64 * \return None.
65 */
66 void Unbind() const override;
67 };
68}
void SetIndexBuffer(const shared< index_buffer > &IndexBuffer)
gl_vertex_array(mesh_type MeshType)
void Unbind() const override
void Bind() const override
void SetVertexBuffer(const shared< vertex_buffer > &VertexBuffer)
render_primitive::handle GetHandle() const override
shared< vertex_buffer > VertexBuffer
Definition: vertex_array.h:31
shared< index_buffer > IndexBuffer
Definition: vertex_array.h:32
Definition: base.h:33
std::shared_ptr< T > shared
Definition: smart_ptr.h:15
shader_variable_type
mesh_type
Definition: vertex_array.h:18
Vertex array interfaces implementation module.