View Full Version : 2D dynamic shadows?

01-10-2013, 02:48 PM
Hello, that's my first post here. I have a plan to develop a small game ( probably just for me, I don't belive it could become any popular ), today I found ClanLib, as I read a few examples and tutorials I got amazed by some of the features ( mostly networking ). My game would be a 2D shooter ( with some twists that I'll skip ) and the very important thing is, that I need soft dynamic shadows ( flashlight + few other lights ). I could use SFML, get the lighting engine from their forums and just use it, but as I mentioned ClanLib seems to be way better in many ways. And this is my question, is there an easy way to get an effect of 2D dynamic shadows in ClanLib?

01-14-2013, 02:16 PM
I'm sorry, we don't have any examples that demonstrate such functionality.

01-14-2013, 03:46 PM
Thank you for your answer, I decided to code my own lighting engine ( something simple, shouldn't be hard ). I already have everything planned and the only thing I'm not sure about for now is ( that's pretty trivial ) drawing a line using gradient instead of constant color ( can work it around, but I doubt it will be effective ).

Edit : I found the way, CL_GraphicContext::draw_primitives is the answer. Now I have to think a bit about which way will be better ( drawing shaped light vs drawing full light and casting shadows ).