added basic d3d support