This page has been translated automatically.
编程
Fundamentals
Setting Up Development Environment
UnigineScript
High-Level Systems
C++
UUSL (Unified UNIGINE Shader Language)
File Formats
Rebuilding the Engine and Tools
GUI
Double Precision Coordinates
应用程序接口
Containers
Common Functionality
Controls-Related Classes
Engine-Related Classes
Filesystem Functionality
GUI-Related Classes
Math Functionality
Node-Related Classes
Networking Functionality
Pathfinding-Related Classes
Physics-Related Classes
Plugins-Related Classes
Rendering-Related Classes
注意! 这个版本的文档是过时的,因为它描述了一个较老的SDK版本!请切换到最新SDK版本的文档。
注意! 这个版本的文档描述了一个不再受支持的旧SDK版本!请升级到最新的SDK版本。

Application with Direct3D11 via SharpDX Library

This article describes the sample located in the <UnigineSDK>/source/csharp/samples/App/D3D11SharpAppForm/ 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.
Notice
The sample can be run on Windows only.

Running Sample

To run the sample, you should do the following:

  1. Prepare the development environment:
    Notice
    Microsoft .NET Framework 4 or higher is required.
    Notice
    SharpDX library will be installed automatically when you install Unigine SDK.
  2. Open the Visual C# main_x86.csproj (or main_x64.csproj) project file located in the <UnigineSDK>/source/csharp/samples/App/D3D11SharpAppForm/ folder.
  3. 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.Appclass. In this class thedoUpdate(), doRender()anddoSwap() functions are overridden and call the update(), render()andswap()functions respectively.
  • AppFormControl - inherits the System.Windows.Forms.Formclass. 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.
Notice
AppForm, AppFormControl, D3D11SharpAppForm are defined in the Unigine namespace.

See Also

Last update: 2017-07-03
Build: ()