In case it helps anyone else: It turns out Get() methods such as OMGetDepthStencilState() also increases the RefCount - and now that I think about it, of course it does... those pointers would have to be released aswell.
I'm converting my OpenGL 4 renderer to DirectX 11. Once I got over making a simple textured triangle, the rest went very easy, I now have a deferred shader setup with ambient/point/directional lights and am now reimplementing the shadow mapping parts, starting with point lights (omnidirectional shadowmaps).
My idea with max distance is to have it be 0 at maxDistance and 1 at the centre, so it clamps between the two. Then to have an additional parameter, what I call "FalloffFactor" to be how steep the falloff is between 1 and maxdistance
At the moment I'm ready to accept the simplest just to get the actual light volume working properly before trying a better formula, as shown it dosnt work properly in the pcitures in the previous post - something is bollocks and I dont know what
Start coding asap and then go back to refactor once you've got some naive implementation. It might be disheartening knowing much of your first implementation might get scrapped but when actually coding you'll stumble into all sorts of problems you probably could never have dreamt of while designing, and even if you spent days on a solid design the first implementation is hardly water-proof no matter how much you prepare.
Refactor and iterate is king, especially in hobby projects when you can go back how many times you want and find and correct your past mistakes, you'll quickly progress into a better programmer overall
I will strongly recommend http://www.arcsynthesis.org/gltut/index.html. I am using it and it is way more in-depth than anything else I've found on the internet, I have bought the OpenGL Superbible but I never really use it anymore
+1 for refactoring, it is a little dishearthening to know you are writing code you know you are probably gonna refactor soon but it's impossible to get it right on the first attempt. Gets your brain working though and that's important, I do it all the time in my hobby projects. It is also pleasing mentally to clean up old code. There's a good book called "The pragmatic programmer" (http://www.amazon.com/Pragmatic-Programmer-Journeyman-Master/dp/020161622X) I highly recommend.
A little bit harder to convince people at work, especially non-programmers, the value of spending some time and go back refactoring old code instead of adding new features though...