1
Graphics / Re: No display in renderTarget?
« on: July 04, 2014, 03:26:57 am »A renderer would merely draw to its target and no more. Leaving the display() call to the code that actually instantiates and thus owns the RenderWindow or RenderTexture is the better way of doing things. After all, drawing might not be limited to your renderer. There might be others who want to draw as well, and prematurely calling display() before the complete frame is rendered is not recommended.
This is probably a better way of doing it, I suppose. I'm still a little bleary on my implementation details so I can't say for sure.
Let me think out loud for a moment:
A likely reason to use a renderTexture is to create something like a light map which is drawn "off screen". Is this correct?
So then you can take this off-screen texture, bind it to a sprite, and draw it (with blending) over/with the actual renderWindow contents. Still on track?
My concern is passing around "unfinished" renderTextures to the final blending/mixing operation. Whoever calls that operation needs to know to "finish/display" the renderTexture before it does the final display.
Quote
Another thing, why would you try to design your own interface when SFML already provides sf::Drawable?I'm doing the bit that takes a sorted list of sf::Drawables and actually does the state setting and calling of draw() to a given target.
This is the first time I'm trying to do something that isn't just a hard coded blob of draw calls.