big rendering overhaul (cleaning and api abstraction)
This commit is contained in:
@ -133,7 +133,7 @@ void finally_draw_billboard_batch(struct MeshBatch const *batch,
|
||||
|
||||
command.vertices = (AttributeArrayPointer) {
|
||||
.arity = 3,
|
||||
.type = GL_FLOAT,
|
||||
.type = TWN_FLOAT,
|
||||
.stride = offsetof(ElementIndexedBillboard, v1),
|
||||
.offset = offsetof(ElementIndexedBillboard, v0),
|
||||
.buffer = buffer
|
||||
@ -141,7 +141,7 @@ void finally_draw_billboard_batch(struct MeshBatch const *batch,
|
||||
|
||||
command.texcoords = (AttributeArrayPointer) {
|
||||
.arity = 2,
|
||||
.type = GL_FLOAT,
|
||||
.type = TWN_FLOAT,
|
||||
.stride = offsetof(ElementIndexedBillboard, v1),
|
||||
.offset = offsetof(ElementIndexedBillboard, uv0),
|
||||
.buffer = buffer
|
||||
@ -149,7 +149,7 @@ void finally_draw_billboard_batch(struct MeshBatch const *batch,
|
||||
|
||||
command.colors = (AttributeArrayPointer) {
|
||||
.arity = 4,
|
||||
.type = GL_UNSIGNED_BYTE,
|
||||
.type = TWN_UNSIGNED_BYTE,
|
||||
.stride = offsetof(ElementIndexedBillboard, v1),
|
||||
.offset = offsetof(ElementIndexedBillboard, c0),
|
||||
.buffer = buffer
|
||||
@ -159,14 +159,19 @@ void finally_draw_billboard_batch(struct MeshBatch const *batch,
|
||||
command.texture_key = texture_key;
|
||||
|
||||
command.element_buffer = get_quad_element_buffer();
|
||||
command.element_count = 6 * (GLsizei)primitives_len;
|
||||
command.range_end = 6 * (GLsizei)primitives_len;
|
||||
command.element_count = 6 * (uint32_t)primitives_len;
|
||||
command.range_end = 6 * (uint32_t)primitives_len;
|
||||
|
||||
/* TODO: support alpha blended case, with distance sort */
|
||||
TextureMode mode = textures_get_mode(&ctx.texture_cache, texture_key);
|
||||
if (mode == TEXTURE_MODE_GHOSTLY)
|
||||
mode = TEXTURE_MODE_SEETHROUGH;
|
||||
use_texture_mode(mode);
|
||||
|
||||
command.texture_mode = mode;
|
||||
command.pipeline = PIPELINE_SPACE;
|
||||
|
||||
command.depth_range_high = depth_range_high;
|
||||
command.depth_range_low = depth_range_low;
|
||||
|
||||
DeferredCommand final_command = {
|
||||
.type = DEFERRED_COMMAND_TYPE_DRAW,
|
||||
|
Reference in New Issue
Block a user