17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-10-29 13:57:28 +01:00

pch migration to modules [wip]

This commit is contained in:
maj00r
2026-09-09 20:35:26 +02:00
parent c3007e3237
commit 3f7960aad5
350 changed files with 5958 additions and 3059 deletions

44
gl/vao.cppm Normal file
View File

@@ -0,0 +1,44 @@
module;
#include <vector>
export module eu07.gl.vao;
import eu07.gl.object;
import eu07.gl.bindable;
import eu07.gl.buffer;
export {
namespace gl
{
class vao : object, public bindable<vao>
{
struct attrib_params {
// TBD: should be shared_ptr? (when buffer is destroyed by owner VAO could still potentially exist)
gl::buffer &buffer;
int attrib;
int size;
int type;
int stride;
int offset;
};
buffer *ebo = nullptr;
std::vector<attrib_params> params;
public:
vao();
~vao();
void setup_attrib(buffer &buffer, int attrib, int size, int type, int stride, int offset);
void setup_ebo(buffer &ebo);
void bind();
static void unbind();
static bool use_vao;
};
}
} // export