Abstract the global renderer, physics, camera and gamemap objects behind a pointer, so you can swap in and out different ones as needed

This commit is contained in:
2026-06-02 13:15:26 -04:00
parent 941eeb2493
commit 9fed59c4c8
12 changed files with 96 additions and 84 deletions

View File

@@ -20,11 +20,11 @@ void akgl_draw_background(int w, int h)
for (x = 0; x < w; x += dx) {
/* use an 8x8 checkerboard pattern */
i = (((x ^ y) >> 3) & 1);
SDL_SetRenderDrawColor(renderer.sdl_renderer, col[i].r, col[i].g, col[i].b, col[i].a);
SDL_SetRenderDrawColor(renderer->sdl_renderer, col[i].r, col[i].g, col[i].b, col[i].a);
rect.x = (float)x;
rect.y = (float)y;
SDL_RenderFillRect(renderer.sdl_renderer, &rect);
SDL_RenderFillRect(renderer->sdl_renderer, &rect);
}
}
}