Graphics Reference
In-Depth Information
This completes the changes to our
Common.WinRT
project. Next, we will create
a
Hello World
Direct3D Windows Store app rendering directly to the application's
CoreWindow
instance.
3. Visual Studio 2013 does not provide us with a suitable C# project template to create
a non-XAML Windows Store app, so we will begin by creating a new C# Windows Store
Blank App (XAML) project.
4. Add references to the SharpDX assemblies:
SharpDX.dll
,
SharpDX.Direct3D11.
dll
,
SharpDX.D3DCompiler.dll
, and
SharpDX.DXGI.dll
. Also, add a reference
to the
Common.WinRT
project.
5. Next, we remove the two XAML files from the project:
App.xaml
and
MainPage.xaml
.
6.
We will replace the previous application entry point,
App.xaml
, with a new static
class called
App
. This will house the main entry point for our application where
we start our Windows Store app using a custom view provider, as shown in the
following snippet:
using Windows.ApplicationModel.Core;
using Windows.Graphics.Display;
using Windows.UI.Core;
...
internal static class App
{
[MTAThread]
private static void Main()
{
var viewFactory = new D3DAppViewProviderFactory();
CoreApplication.Run(viewFactory);
}
// The custom view provider factory
class D3DAppViewProviderFactory : IFrameworkViewSource
{
public IFrameworkView CreateView()
{
return new D3DAppViewProvider();
}
}
class D3DAppViewProvider
: SharpDX.Component, IFrameworkView
{
...
}
}