The current RenderData based system is actually much more inefficient than I thought.
A much better system would have a FrameRenderer object, a reference to which is passed to every object in its draw function. Rather than filling out a RenderData struct, you call the appropriate draw_sprite, add_post_processing_effect, draw_particles, etc. methods.
Once every object has registered what it wants to do with FrameRenderer, FrameRenderer then calls the appropriate methods on Renderer to actually draw stuff.
This way I avoid creating hundreds of arrays for all the RenderData structs I'm making.
The current
RenderData
based system is actually much more inefficient than I thought.A much better system would have a
FrameRenderer
object, a reference to which is passed to every object in its draw function. Rather than filling out aRenderData
struct, you call the appropriatedraw_sprite
,add_post_processing_effect
,draw_particles
, etc. methods.Once every object has registered what it wants to do with
FrameRenderer
,FrameRenderer
then calls the appropriate methods onRenderer
to actually draw stuff.This way I avoid creating hundreds of arrays for all the
RenderData
structs I'm making.