Coffeehouse Thread

18 posts

New Direct2D wrapper for next version of .net?

Back to Forum: Coffeehouse
  • User profile image
    Frank Hileman

    In all the information leaked about Windows 8 and .net 4.5, is there any indication we have a new managed wrapper for Direct2D? It is fine to code directly to Direct2D currently, but it is difficult to create libraries that work with both 32 and 64 bit applications.

  • User profile image
    kettch

    I believe that is all now part of what is being called DirectUI. For the sake of backwards compatibility, I'm sure you'll still be able to write against Direct2D directly, but moving forward we'll be encouraged to target DirectUI as the new unified API.

  • User profile image
    Frank Hileman

    Can you point to any site or blog where a new immediate mode API is visible? Thanks!

  • User profile image
    kettch

    @Frank Hileman: All that is available is rumor and speculation based on dissecting the leaked builds.

    There are a number of links in this thread that point to what little is available. Microsoft has so far remained silent, allowing the blogsphere to whip itself into a frothing frenzy. Quite entertaining, actually.

  • User profile image
    Frank Hileman

    @kettch: Thanks, but in the mydigitallife forum thread, I could not see any namespace that was definitely for immediate mode rendering. 

  • User profile image
    aL_

    from what ive been able to gather, DirectUI is a high(er) level ui framework utilizing xaml but written in native code on top of direct2d

    i havent heard of any new managed version of direct2d. However, it looks like interoping with the regular native direct2d will be alot easier via the windows runtime, possibly allowing us to write c# but compile it to native code. it also seems like you can target directUI from c# as well

    no one really knows though.. build cant come soon enough Tongue Out

  • User profile image
    evildictait​or

    Direct2D apis just call Direct3D using textures on top of XYZ_RHW (post-translation) vertexes, so if you want a fast .NET way to do this your best bet is XNA - in particular the SpriteBatch class which draws 2D textures to the screen.

  • User profile image
    Dexter

    ,Frank Hileman wrote

    @kettch: Thanks, but in the mydigitallife forum thread, I could not see any namespace that was definitely for immediate mode rendering. 

    Indeed, there isn't. The only graphics namespace that's available is Windows.Graphics.Imaging which is a simple wrapper for WIC. Well, there's Windows.UI.DirectUI.Shapes but I suppose you aren't looking for that.

    ,evildictait​or wrote

    Direct2D apis just call Direct3D using textures on top of XYZ_RHW (post-translation) vertexes, so if you want a fast .NET way to do this your best bet is XNA - in particular the SpriteBatch class which draws 2D textures to the screen.

    Umm, there's way more than that going on inside 2D. If you're not familiar with the subject maybe you should not make baseless affirmations such as this one.

     

  • User profile image
    spivonious

    Since MS seems to be heading towards a merging of native and managed code with the Windows Runtime, I wouldn't doubt that a managed API for Direct2D will be in .NET 4.5 or Jupiter.

    It's too bad that BUILD is so far off. At least all of the hubbub shows that the Windows dev community is alive and well.

  • User profile image
    evildictait​or

    ,Dexter wrote

    Umm, there's way more than that going on inside 2D. If you're not familiar with the subject maybe you should not make baseless affirmations such as this one.

    I'm not sure what you're objecting to in my statement. It is a simple matter of fact that Direct2D calls the Direct3D APIs to trap to the dxapi.sys - Direct2D calls Direct3D to do it's rendering. That's how DirectX (and for that matter GDI) works.

  • User profile image
    Dexter

    That D2D calls D3D is obvious. What doesn't seem to be obvious is that before doing that, D2D must tesselate the geometry because D3D has no clue how to draw an ellipse for example.

    And then you have stroke styles, gradient brushes, text rendering support. And geometry operations like combine and widen which don't have anything to do with calling D3D.

    So yeah, I guess you could use XNA and its SpriteBatch because implementing all of the above is trivial and implementing your own SpriteBatch is not. Oh wait...

  • User profile image
    evildictait​or

    Thanks for the sarcasm. It really makes me want to try and help you again in future. I won't bother to remind you that you can already do text and ellipses and gradients and stroke styles and combine operations in XNA, because you're so amazingly smart that you clearly already know everything in the world, which is why you asked a question and then attacked me for trying to help.

  • User profile image
    Dexter

    ,evildictait​or wrote

    Thanks for the sarcasm. It really makes me want to try and help you again in future. I won't bother to remind you that you can already do text and ellipses and gradients and stroke styles and combine operations in XNA, because you're so amazingly smart that you clearly already know everything in the world, which is why you asked a question and then attacked me for trying to help.

    Well, feel free to bother to remind me all that... if you can also point to some documentation/samples to back it up.

  • User profile image
    Frank Hileman

    @evildictaitor: Direct2D is the type of API I am looking for, not XNA. Thanks anyway.

    There is a lot more to Direct2D than XNA or Direct3D, for 2d rendering.

  • User profile image
    ZippyV

    Isn't there already a .net wrapper for Direct2D (not xna)?

    EDIT: This one: http://archive.msdn.microsoft.com/WindowsAPICodePack

  • User profile image
    Frank Hileman

    @ZippyV: Yes, but it is not part of the framework, nor maintained well. Also, the 32/64 bit problem is not addressed (how to create a single library compiled to anycpu, that works for both).

  • User profile image
    aL_

    @Frank Hileman:

    while its not part of the framework, id take a look at http://slimdx.org/ its an open source managed wrapper around directx that is pretty well maintained. currently they support:

    Math Library
    Direct3D9
    Direct3D9Ex
    Direct3D10
    Direct3D10.1
    Direct3D11
    D3DCompiler
    Direct2D
    DirectWrite
    DirectInput
    DirectSound
    DXGI
    DXGI 1.1
    Windows Multimedia
    Raw Input
    X3DAudio
    XAPO
    XACT3
    XAudio2
    XInput

     

  • User profile image
    Frank Hileman

    @aL_: Also there is SharpDX, which seems to be faster.

    I was hoping for a lowest-overhead solution provided by Microsoft.

Comments closed

Comments have been closed since this content was published more than 30 days ago, but if you'd like to continue the conversation, please create a new thread in our Forums, or Contact Us and let us know.