Go to the source code of this file.
Functions | |
void | cell_init_vbuf (struct cell_context *cell) |
Initialize the post-transform vertex buffer information for the given context. |
void cell_init_vbuf | ( | struct cell_context * | cell | ) |
Initialize the post-transform vertex buffer information for the given context.
Definition at line 272 of file cell_vbuf.c.
References vbuf_render::allocate_vertices, assert, cell_vbuf_render::base, CALLOC_STRUCT, cell_vbuf_render::cell, CELL_BUFFER_SIZE, cell_vbuf_allocate_vertices(), cell_vbuf_destroy(), cell_vbuf_draw(), cell_vbuf_get_vertex_info(), cell_vbuf_release_vertices(), cell_vbuf_set_primitive(), vbuf_render::destroy, vbuf_render::draw, cell_context::draw, draw_vbuf_stage(), vbuf_render::get_vertex_info, vbuf_render::max_indices, vbuf_render::max_vertex_buffer_bytes, vbuf_render::release_vertices, vbuf_render::set_primitive, cell_context::vbuf, cell_context::vbuf_render, and cell_vbuf_render::vertex_buf.
00273 { 00274 assert(cell->draw); 00275 00276 cell->vbuf_render = CALLOC_STRUCT(cell_vbuf_render); 00277 00278 /* The max number of indexes is what can fix into a batch buffer, 00279 * minus the render and release-verts commands. 00280 */ 00281 cell->vbuf_render->base.max_indices 00282 = (CELL_BUFFER_SIZE 00283 - sizeof(struct cell_command_render) 00284 - sizeof(struct cell_command_release_verts)) 00285 / sizeof(ushort); 00286 cell->vbuf_render->base.max_vertex_buffer_bytes = CELL_BUFFER_SIZE; 00287 00288 cell->vbuf_render->base.get_vertex_info = cell_vbuf_get_vertex_info; 00289 cell->vbuf_render->base.allocate_vertices = cell_vbuf_allocate_vertices; 00290 cell->vbuf_render->base.set_primitive = cell_vbuf_set_primitive; 00291 cell->vbuf_render->base.draw = cell_vbuf_draw; 00292 cell->vbuf_render->base.release_vertices = cell_vbuf_release_vertices; 00293 cell->vbuf_render->base.destroy = cell_vbuf_destroy; 00294 00295 cell->vbuf_render->cell = cell; 00296 #if 1 00297 cell->vbuf_render->vertex_buf = ~0; 00298 #endif 00299 00300 cell->vbuf = draw_vbuf_stage(cell->draw, &cell->vbuf_render->base); 00301 }