I'm a relatively new user of SlimDX and DirectX, and I am struggling with a few things, but I'll ask about one thing at a time.
I want to combine a breathtaking 2D user interface into the game engine I am planning to play around with. I have been led to believe(by myself that is) that this is most easily accomplished with Direct2D and DirectWrite in combination with Direct3D.
The rest of my question is basically a follow up if the answer is yes to the following question so you can ignore the rest if it isn't.
Is Direct2D / DirectWrite the way to go to render great text/shapes? Specifically for something like a fluid UI with transparency and fluid animation?
If not, what should I try instead?
If it is a good approach, can someone tell me what my mistake is in the following code? Some things are excluded for brevity, ask me for more if you need!
public void StartEngine() { Device = new SlimDX.Direct3D10_1.Device1(Factory.GetAdapter(0), DriverType.Hardware, DeviceCreationFlags.BgraSupport, SlimDX.Direct3D10_1.FeatureLevel.Level_10_0); ... ... ... RenderTarget = RenderTarget.FromDXGI(D2DFactory, surface, new RenderTargetProperties() { PixelFormat = new PixelFormat(surface.Description.Format, AlphaMode.Straight), Type = RenderTargetType.Hardware, Usage = RenderTargetUsage.None }); }
When I try to create my render target, a Direct2DException is thrown, with the following text:
D2DERR_UNSUPPORTED_PIXEL_FORMAT: The pixel format is not supported. (-2003292288)
Any ideas what I am doing wrong? Also, sorry if this has been asked before but google told me no...