❖
Monad Engine
da02fba2
>
Undercity Codex
_
Loading...
Searching...
No Matches
Mesh.h
Go to the documentation of this file.
1
#pragma once
2
#include <GL/glew.h>
3
#include "graphics/VertexLayout.h"
4
5
#include <glm//vec3.hpp>
6
7
#include <memory>
8
#include <string>
9
10
namespace
eng
11
{
12
class
Mesh
13
{
14
public
:
15
Mesh
(
const
VertexLayout
& layout,
const
std::vector<float>& vertices,
const
std::vector<uint32_t>& indices);
16
Mesh
(
const
VertexLayout
& layout,
const
std::vector<float>& vertices);
17
Mesh
(
const
Mesh
&) =
delete
;
18
Mesh
&
operator=
(
const
Mesh
&) =
delete
;
19
20
void
Bind
();
21
void
Unbind
();
22
void
Draw
();
23
24
static
std::shared_ptr<Mesh>
CreateBox
(
const
glm::vec3& extents = glm::vec3(1.0f));
25
static
std::shared_ptr<Mesh>
CreateSphere
(
float
radius,
int
sectors,
int
stacks);
26
static
std::shared_ptr<Mesh>
CreatePlane
();
27
28
private
:
29
VertexLayout
m_vertexLayout;
30
GLuint
m_VBO = 0;
31
GLuint
m_EBO = 0;
32
GLuint
m_VAO = 0;
33
34
size_t
m_vertexCout = 0;
35
size_t
m_indexCount = 0;
36
};
37
}
GLuint
unsigned int GLuint
Definition
GLForward.h:11
eng::Mesh
Definition
Mesh.h:13
eng::Mesh::Unbind
void Unbind()
Definition
Mesh.cpp:69
eng::Mesh::Mesh
Mesh(const Mesh &)=delete
eng::Mesh::operator=
Mesh & operator=(const Mesh &)=delete
eng::Mesh::Draw
void Draw()
Definition
Mesh.cpp:74
eng::Mesh::CreatePlane
static std::shared_ptr< Mesh > CreatePlane()
Definition
Mesh.cpp:277
eng::Mesh::CreateBox
static std::shared_ptr< Mesh > CreateBox(const glm::vec3 &extents=glm::vec3(1.0f))
Definition
Mesh.cpp:86
eng::Mesh::CreateSphere
static std::shared_ptr< Mesh > CreateSphere(float radius, int sectors, int stacks)
Definition
Mesh.cpp:187
eng::Mesh::Bind
void Bind()
Definition
Mesh.cpp:64
eng
Definition
Application.cpp:4
eng::VertexLayout
Definition
VertexLayout.h:22
docs
GD-Engine-lesson-5-2
engine
source
render
Mesh.h
Generated by
1.9.8