Refactored Direct3D, needs extra comments