3 #include "vg/vg_async.h"
7 typedef struct scene_context scene_context
;
8 typedef struct scene_vert scene_vert
;
12 /* 32 byte vertexs, we don't care about the normals too much,
13 * maybe possible to bring down uv to i16s too */
19 u16 flags
; /* only for the cpu. its junk on the gpu */
26 * 1. this should probably be a CONTEXT based approach unlike this mess.
27 * take a bit of the mdl_context ideas and redo this header. its messed up
28 * pretty bad right now.
33 scene_vert
*arrvertices
;
36 u32 vertex_count
, indice_count
,
37 max_vertices
, max_indices
;
43 extern bh_system bh_system_scene
;
44 bh_tree
*scene_bh_create( void *lin_alloc
, scene_context
*s
);
45 int scene_raycast( scene_context
*s
, bh_tree
*bh
,
46 v3f co
, v3f dir
, ray_hit
*hit
, u16 ignore
);
47 vg_async_item
*scene_alloc_async( scene_context
*scene
, glmesh
*mesh
,
48 u32 max_vertices
, u32 max_indices
);
49 void scene_copy_slice( scene_context
*ctx
, mdl_submesh
*sm
);
50 void scene_push_vert( scene_context
*ctx
, scene_vert
*v
);
51 void scene_vert_pack_norm( scene_vert
*vert
, v3f norm
, f32 blend
);
52 void scene_push_tri( scene_context
*ctx
, u32 tri
[3] );
53 void scene_add_mdl_submesh( scene_context
*ctx
, mdl_context
*mdl
,
54 mdl_submesh
*sm
, m4x3f transform
);
55 void scene_set_vertex_flags( scene_context
*ctx
,
56 u32 start
, u32 count
, u16 flags
);
57 void scene_supply_buffer( scene_context
*ctx
, void *buffer
);
58 void scene_init( scene_context
*ctx
, u32 max_vertices
, u32 max_indices
);
59 u32
scene_mem_required( scene_context
*ctx
);
60 void async_scene_upload( void *payload
, u32 size
);
61 void scene_upload_async( scene_context
*ctx
, glmesh
*mesh
);