Using Win2D from Visual Basic

My colleague Lucian Wischik is in the middle of a blog/video series about creating Universal Windows Apps with Visual Basic.  In part 8, he talks about Win2D.  Fractal circles FTW!

Comments (6)

  1. Bob Saget says:

    So, you've got graphics.

    Are you going to do anything about sound? It'd be really nice to be able to call XAudio or whatever from C# as well. What good are explosions without sounds?

    If people are going to use this thing, it needs to be a complete solution.

  2. Win2D is a graphics API, so sound is not in scope for this particular project.  Win2D alone is not intended to be complete solution for all possible programming tasks!  It is just a small part of the larger Windows Runtime, which /is/ a complete solution.

    For playing sounds the Windows.Media.Audio namespace looks like a good place to start (although I am far from expert in this area).

  3. Some options for audio:

    * SharpDX is a wrapper around XAudio2. It's not as beautiful as win2d, but it's not that bad. I wrote a blog about using it to play sound effects:…/vb-universal-app-part-4-using-sharpdx-for-sound-effects-with-ioc-and-linkedfiles.aspx

    * MonoGame. I've not used it. But it's basically a cross-platform reimplementation of XNA. It uses SharpDX under-the-hood on Windows platforms.

    * If you want low-level access to the raw PCM audio, for either recording or playback, it's down to p/invoke. I wrote about how to do this from .NET here:…/Recording-and-playing-PCM-audio-on-Windows-VB

    I've not yet combined Win2d with SharpDX->XAudio2 but I can't imagine there'd be any problems.

  4. Bob Saget says:

    Why would I eat all the restrictions of using Win2D if I'm going to use SharpDX anyway?

    The only benefit of Win2D is that it should be easier to use than SharpDX.

    Can Win2D universal apps even run in full screen exclusive mode with no menu bar?

  5. Bob,

    If you like SharpDX and it does what you need, you should absolutely use SharpDX.   Or you can use SharpDX for some things alongside Win2D for others.  Your choice of graphics API and audio API are pretty much orthogonal.

    Win2D makes some things quite a bit easier than they would be using SharpDX.  This is important to some people; not so much to others.

    All Universal Windows apps can be run in full screen mode with no menu bar.  That's a feature of the platform, not of any particular graphics API.

  6. Bob Saget says:

    Can Universal Windows apps be launched on Windows start up? Can Universal Windows apps serve as a shell replacement? I'm trying to decide whether I can switch from WPF to a Universal App and still get all the functionality I have now.

Skip to main content