mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
'Assets', some refactor
This commit is contained in:
parent
b7e8ff5bea
commit
2aba3e91db
19 changed files with 350 additions and 213 deletions
18
src/graphics/Batch2D.cpp
Normal file
18
src/graphics/Batch2D.cpp
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
#include "Batch2D.h"
|
||||
#include "Mesh.h"
|
||||
|
||||
Batch2D::Batch2D(size_t capacity) : capacity(capacity),
|
||||
offset(0),
|
||||
color(1.0f, 1.0f, 1.0f, 1.0f){
|
||||
const int attrs[] = {
|
||||
2, 2, 4, 0 //null terminator
|
||||
};
|
||||
|
||||
buffer = new float[capacity];
|
||||
mesh = new Mesh(nullptr, 0, attrs);
|
||||
}
|
||||
|
||||
Batch2D::~Batch2D(){
|
||||
delete buffer;
|
||||
delete mesh;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue