Component-based Rendering

Posted by Kikaimaru on Game Development See other posts from Game Development or by Kikaimaru
Published on 2012-02-13T17:09:18Z Indexed on 2012/04/13 23:46 UTC
Read the original article Hit count: 289

I have component Renderer, that Draws Texture2D (or sprite) According to component-based architecture i should have only method OnUpdate, and there should be my rendering code, something like

spriteBatch.Draw(Texture, Vector2.Zero, Color.White)

But first I need to do spriteBatch.Begin();. Where should i call it? And how can I make sure it's called before any Renderer components OnUpdate method?

(i need to do more stuff then just Begin() i also need to set right rendertarget for camera etc.)

© Game Development or respective owner

Related posts about sprites

Related posts about rendering