Application with Direct3D11 via SharpDX Library
The functionality described in this article is not available in the Community SDK edition.
You should upgrade to- Engineering / Sim
SDK edition to use it.
You should upgrade to
This article describes the sample located in the <UnigineSDK>/source/csharp/apps/main_winform/D3D11SharpDXAppForm/ folder.
The sample demonstrates how to embed Unigine into a Windows Forms application:
- Create a Windows Forms application and embed Unigine into it.
- Initialize Direct3D11 by using SharpDX library.
The sample can be run on Windows only.
Running Sample#
To run the sample, you should do the following:
- Prepare the development environment:
- Install Microsoft Visual Studio for C# (Visual C# Express). It can be downloaded for free.
Microsoft Visual Studio Community 2015 supports multiple languages and C# by default. Read more about the Visual Studio Community 2015 IDE.
- Install Microsoft Windows SDK 7.x (can be downloaded for free).
- Install DirectX redistributive June 2010 (can be downloaded for free).
- Install Python 2.7 (can be downloaded for free).
- Install SCons 2.0+ (can be downloaded for free).
Microsoft .NET 5 or higher is required.SharpDX library will be installed automatically when you install UNIGINE SDK. - Install Microsoft Visual Studio for C# (Visual C# Express). It can be downloaded for free.
- Open the Visual C# main_x64.csproj project file located in the <UnigineSDK>/source/csharp/apps/main_winform/D3D11SharpDXAppForm/ folder.
- Click the
button on the toolbar (or
DEBUG -> Start Debugging) to start the project.
Windows Form Application will open.
Description of C# classes#
This sample contains 4 classes:
- AppForm — inherits the Unigine.App class. In this class thedoUpdate(), doRender() anddoSwap() functions are overridden and call the update(), render() andswap() functions respectively.
- AppFormControl — inherits the System.Windows.Forms.Form class. This class implements all the necessary events, which will be performed when user interacts with the application.
- D3D11SharpAppForm — inherits the AppForm class and initializes the graphics Direct3D11 API in the Windows Forms Application via the SharpDX library.
- UnigineApp — defines the entry point of the program. C# Wrapper and Engine are initialized here.
AppForm, AppFormControl, D3D11SharpAppForm are defined in the Unigine namespace.
See Also#
- Article on App Class to learn how to create an application based on the Unigine.App class.
Last update:
2021-12-13
Help improve this article
Was this article helpful?
(or select a word/phrase and press Ctrl+Enter)