Renderers no longer have an init function and are expected to be prepared in their constructor (whatever it is)

We can do something similar for input processor (probably a good idea?) or go with the plan for game and use a template, engine can know about the renderers as long as it treats them as generic pointers, but shouldn't know about the game
Game can either be a templated make_unique or we can just enforce a game class naming
Or pass game in at start loop
This commit is contained in:
2022-01-20 08:49:32 -05:00
parent bc6fa836b0
commit a01ff2ec0e
5 changed files with 38 additions and 40 deletions

View File

@@ -18,8 +18,10 @@ struct SDL_WindowDeleter {
class SdlRenderer : public Renderer {
public:
~SdlRenderer() override;
SdlRenderer(RendererParams renderer_params);
void draw_text(std::optional<TextRenderDetails> details, std::string text, int x, int y) override;
void initialize(RendererParams params) override;
void flush() override;
void draw_point(int x, int y, Color color) override;