mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-11 22:11:51 +00:00
just a minor refactor, nothing special
This commit is contained in:
parent
6e2bc9ca95
commit
9f2bceb039
67 changed files with 143 additions and 143 deletions
|
|
@ -1,42 +0,0 @@
|
|||
#ifndef GRAPHICS_CORE_MESH_H_
|
||||
#define GRAPHICS_CORE_MESH_H_
|
||||
|
||||
#include <stdlib.h>
|
||||
#include "../../typedefs.h"
|
||||
|
||||
struct vattr {
|
||||
ubyte size;
|
||||
};
|
||||
|
||||
class Mesh {
|
||||
unsigned int vao;
|
||||
unsigned int vbo;
|
||||
unsigned int ibo;
|
||||
size_t vertices;
|
||||
size_t indices;
|
||||
size_t vertexSize;
|
||||
public:
|
||||
Mesh(const float* vertexBuffer, size_t vertices, const int* indexBuffer, size_t indices, const vattr* attrs);
|
||||
Mesh(const float* vertexBuffer, size_t vertices, const vattr* attrs) :
|
||||
Mesh(vertexBuffer, vertices, nullptr, 0, attrs) {};
|
||||
~Mesh();
|
||||
|
||||
/// @brief Update GL vertex and index buffers data without changing VAO attributes
|
||||
/// @param vertexBuffer vertex data buffer
|
||||
/// @param vertices number of vertices in new buffer
|
||||
/// @param indexBuffer indices buffer
|
||||
/// @param indices number of values in indices buffer
|
||||
void reload(const float* vertexBuffer, size_t vertices, const int* indexBuffer = nullptr, size_t indices = 0);
|
||||
|
||||
/// @brief Draw mesh with specified primitives type
|
||||
/// @param primitive primitives type
|
||||
void draw(unsigned int primitive);
|
||||
|
||||
/// @brief Draw mesh as triangles
|
||||
void draw();
|
||||
|
||||
/// @brief Total numbers of alive mesh objects
|
||||
static int meshesCount;
|
||||
};
|
||||
|
||||
#endif // GRAPHICS_CORE_MESH_H_
|
||||
Loading…
Add table
Add a link
Reference in a new issue