Introducing Win2D: DirectX-Powered Drawing in C#

Download this episode

Download Video

Download captions

Download Captions

Description

Win2D is a new, immediate mode 2D drawing framework for XAML applications on Windows 8.1 and Windows 10. It is built on the high performance foundation of DirectX, but is designed to provide the convenience and ease of use expected by C# and .NET developers. It also is a reimagining of the way that Windows develops APIs: from the start, Win2D has been fully open sourced on GitHub. Come build new apps and help contribute to Win2D!
For more information, check out this course on Microsoft Virtual Academy:

Day:

1

Session Type:

Code Lab

Code:

2-631

Room:

Room 3018

Embed

Format

Available formats for this video:

Actual format may change based on video formats available and browser capability.

    The Discussion

    • User profile image
      alisonst

      Love the webcam demo. :)

    • User profile image
      sosihui

      I WANT OpenGL

      Can't care less about directX

    • User profile image
      shoki

      no win7 support?
      not interested.


      but srsly, why no win7 support??????

    • User profile image
      simontao

      @sosihui: Have you checked out the session on ANGLE, which lets you run OpenGLES code on Windows (via Direct3D)? http://channel9.msdn.com/events/Build/2015/3-686

    • User profile image
      sosihui

      @simontao:ANGLE is translating outdated OpenGL ES 2.0 to DirectX... Who is going to maintain it, provide driver-level compilers for shaders etc? That's right - nobody.

    • User profile image
      TheBitBender

      amazing library, i have been waiting for something like that for ages. i dont get it why the crowd doesnt go nuts from excitement during that demos. this opens so many possibilities.

      besides the c# improvements, visual-studio-enhancements and roslyn one of the most exciting talks at build for me.

      now please please make a similar library that wraps Direct3D !

      and in case there is time left for creating one further library, a math-library for c#/.net that takes advantage of the GPU would really be awesome.

      Huge thanks to Simon Tao and his team. amazing work-bravo

    • User profile image
      simontao

      @sosihui:

      ANGLE is translating outdated OpenGL ES 2.0 to DirectX... 

      If you need OpenGL ES 3.0 support in ANGLE I encourage you to reach out to the angleproject maintainers. It's true that 3.0 has been out for a while but 2.0 is still the standard for a large swath of mobile devices in the market.

      Who is going to maintain it, provide driver-level compilers for shaders etc?

      I'm not sure what your question means here. The ANGLE team @ MS is dedicated to maintaining and improving ANGLE support on Windows over the long term, not including all of the activity around ANGLE in the industry in general. In addition, the main purpose of ANGLE on Windows is to leverage the (well maintained) DirectX runtime, shader-compiler, drivers, etc.

    • User profile image
      simontao

      @TheBitBender: Glad you are interested in Win2D!

      We would love to know more specifics about what kinds of capabilities and scenarios you are looking at. You can leave questions or suggestions on our GitHub page: https://github.com/microsoft/win2d/issues.

      For example, there are other excellent libraries out there such as SharpDX - this one in particular exposes basically all of the DirectX API surface. Are there specific things that you would want in a D3D wrapper library?

      For a GPU-accelerated math library, are you looking for something similar to existing solutions such as DirectCompute, CUDA, OpenCL, etc?

    • User profile image
      Drew Noakes

      Looks great. Would love to use this in LOB apps but unfortunately my clients all still use Windows 7. Maybe in five years I'll get to play with this stuff in my day job.

    • User profile image
      Suave

      This code doesn't run. Getting this error: Could not find SDK "Microsoft.VCLibs, Version=12.0".

       

      What am I missing?

    • User profile image
      Theodore

      Now all that remains is my clients to be convinced to update from Windows 7 (few of them are still using XP) to Windows 8.1/10.

      Yeah... not gonna happen.

      Any chance we see Win2D goodies in WPF ?

    • User profile image
      TheBitBender

      @simontao:thanks for your reply, took me a while to realize you wrote back! :)

      regarding the math-library-topic, yes something like DirectCompute or Cuda would be great. Problem with Cuda is its tied to one manufacturer if i'm not wrong, so it depends if Nivida or AMD made the GPU. DirectCompute seems more hardware-agnostic, but i wouldnt know of a nice math-library for .Net that gives access to DirectCompute yet...except maybe SharpDX does and i just didnt know. But as you are quite likely aware, there is quite a difference to what a c++ developer considers a nice API and what someone used to .net-framework would like to use, and thats why a am not immediately excited if i would find out SharpDX has some way of accessing DirectCompute :)

      also Direct2D is accessible by some wrappers and what Win2D does could theoretically be done via SharpDX, but still what you offer now with Win2D is another liga, because you managed to really transform this into the mindset of .Net.

      so ...just what immediately crosses my mind (if my idea is straight stupid just please dont feel offended *g*), a math library could have all kinds of matrix-operations for huge matrices, doing all computation on the gpu, or like making a lambda chaining calculations together and the lambda gets transformed to GPU code on the fly. i know all sorts of "but you should do this in c++ for performance-reasons"-guys will immediately pop up, but its quite often some code might profit from handing off calculations to the GPU, but the amount of work necessary to dive into the tools currently available makes it seem too unattractive to even try.

      and regarding 3D- your example with the teapot having your Win2D graphics as texture was amazing, but just imagine all the stuff necessary for making the teapot appear and rotate would as well be as easy as your code needed for making the textures in realtime in Win2D. just imagine if you were now used to having Win2D as your primary way of doing graphics, how would this story need to continue to have the same elegance of coding for creating 3D graphics :)

      i believe for many 2D-games Win2D will be a very welcome alternative and viable option as replacement for XNA-Framework. with 3D support i guess you could find lots and lots of new friends in the area of indie-game-developement that still seem upset quite a lot on uservoice about microsoft letting XNA framework die :)

      thanks once more for the reply :)

    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.