blob: 0242cd0c62c44723349a85c8ad0cea6b2d5599ac (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
#ifndef model_hpp
#define model_hpp
#include "asset.hpp"
#include "maths.hpp"
#include "video.hpp"
struct Model;
struct Mesh {
int offset, vbo_offset, count;
int parent, mesh_binding, mvp_binding;
bool world_dirty;
m4f local, world;
Shader_Id shader;
const m4f& get_world(Model& m);
};
struct Model : public Asset {
Buffer_Id vbo;
Buffer_Id ibo;
Buffer_Id mvp;
int mesh_count;
Mesh* get_meshes() {
return (Mesh*)&this[1];
}
void destroy(Device* dev);
void update_transforms();
void render(
Device* dev,
Arena* a,
Render_Pass& pass,
const m4f& transform,
const m4f& view_projection
);
};
struct Model_Loader : public Asset_Loader {
Device* dev;
Asset_Arena* shaders;
void init(Device* device, Asset_Arena* shader_arena);
Asset* load(Arena* a, Arena* s, Pack_File* f) override;
void unload(Asset* a);
};
#endif
|