XNA Creators Club Online
Page 1 of 1 (1 items)
Sort Posts: Previous Next

How to handle spritebatch, shaders etc. with objects drawing themselves?

Last post 6/18/2009 5:48 PM by GeneralDisarray. 0 replies.
  • 6/18/2009 5:48 PM

    How to handle spritebatch, shaders etc. with objects drawing themselves?

    Hi! I'm in the beginning of creating a 2D platformer/shooter. I have started implementing a way of drawing game objects like buildings and cars, with a mixture of tilemaps and single sprites. The point is, my various objects will have different ways of drawing themselves, with different shader effects applied to each object(and maybe different effects within that object, like refraction on the windows of a house).

    What is an efficient way of doing this? The way I have it set up now is based on sending the spritebatch used in my main drawing method into the draw method of each object, and applying the different effects in each individual draw method.

    Does anyone have any good tips on how to handle the design of such a system to obtain good performance? Thanks

Page 1 of 1 (1 items) Previous Next