fix mixing up of SDL and libc allocators, proper flushing of quad build buffers
This commit is contained in:
@ -23,7 +23,7 @@ static void title_tick(State *state) {
|
||||
|
||||
/* draw the tick count as an example of dynamic text */
|
||||
size_t text_str_len = snprintf(NULL, 0, "%llu", (unsigned long long)state->ctx->frame_number) + 1;
|
||||
char *text_str = cmalloc(text_str_len);
|
||||
char *text_str = malloc(text_str_len);
|
||||
snprintf(text_str, text_str_len, "%llu", (unsigned long long)state->ctx->frame_number);
|
||||
|
||||
const char *font = "/fonts/kenney-pixel.ttf";
|
||||
@ -34,8 +34,8 @@ static void title_tick(State *state) {
|
||||
(Rect) {
|
||||
.x = 0,
|
||||
.y = 0,
|
||||
.w = text_w,
|
||||
.h = text_h,
|
||||
.w = (float)text_w,
|
||||
.h = (float)text_h,
|
||||
},
|
||||
(Color) { 0, 0, 0, 255 }
|
||||
);
|
||||
@ -53,7 +53,7 @@ static void title_end(State *state) {
|
||||
Scene *title_scene(State *state) {
|
||||
(void)state;
|
||||
|
||||
SceneTitle *new_scene = ccalloc(1, sizeof *new_scene);
|
||||
SceneTitle *new_scene = calloc(1, sizeof *new_scene);
|
||||
new_scene->base.tick = title_tick;
|
||||
new_scene->base.end = title_end;
|
||||
|
||||
|
Reference in New Issue
Block a user