196
General / New to SFML, game design questions
« on: September 02, 2011, 05:42:51 pm »
The abstract IRenderer is just something you'd need with multiple possible renderers, so you could have IRenderer that then becomes a CSFMLRenderer, a CDX9Renderer, a CDX11Renderer, a CSoftwareRenderer etc.
Otherwise you don't need it, and can just use Renderer*.
The concept of a service as used in XNA seems to be essentially only giving the information other components actually need to those components and hiding the rest of it.
The way they show them there could easily be you have a RendererService and then a RendererComponent that could also be a RendererService, or could even be a friend of RendererService or something, but more importantly it does all the "hidden" work the Renderer needs but doesn't need to expose to the rest of the system.
Or you could even just have a RendererService (Renderer).
Basically a service provider is an extensible way of sharing information between discrete components of the game engine without making that information global. Like I said, it's something you can look into or not ^^
Otherwise you don't need it, and can just use Renderer*.
The concept of a service as used in XNA seems to be essentially only giving the information other components actually need to those components and hiding the rest of it.
The way they show them there could easily be you have a RendererService and then a RendererComponent that could also be a RendererService, or could even be a friend of RendererService or something, but more importantly it does all the "hidden" work the Renderer needs but doesn't need to expose to the rest of the system.
Or you could even just have a RendererService (Renderer).
Basically a service provider is an extensible way of sharing information between discrete components of the game engine without making that information global. Like I said, it's something you can look into or not ^^