This page has been translated automatically.
Видеоуроки
Interface
Essentials
Advanced
Подсказки и советы
Основы
Программирование на C#
Рендеринг
Принципы работы
Свойства (properties)
Компонентная Система
Рендер
Физика
Редактор UnigineEditor
Обзор интерфейса
Работа с ассетами
Настройки и предпочтения
Работа с проектами
Настройка параметров узла
Setting Up Materials
Настройка свойств
Освещение
Landscape Tool
Sandworm
Использование инструментов редактора для конкретных задач
Extending Editor Functionality
Встроенные объекты
Ноды (Nodes)
Объекты (Objects)
Эффекты
Декали
Источники света
Geodetics
World Nodes
Звуковые объекты
Объекты поиска пути
Players
Программирование
Основы
Настройка среды разработки
Примеры использования
UnigineScript
C++
Унифицированный язык шейдеров UUSL
File Formats
Rebuilding the Engine Tools
GUI
Двойная точность координат
API
Containers
Common Functionality
Controls-Related Classes
Engine-Related Classes
Filesystem Functionality
GUI-Related Classes
Math Functionality
Node-Related Classes
Objects-Related Classes
Networking Functionality
Pathfinding-Related Classes
Physics-Related Classes
Plugins-Related Classes
IG Plugin
CIGIConnector Plugin
Rendering-Related Classes
Работа с контентом
Оптимизация контента
Материалы
Art Samples
Tutorials

Application with Direct3D11 via SharpDX Library

Warning
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.

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.
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 5 or higher is required.
    Notice
    SharpDX library will be installed automatically when you install UNIGINE SDK.
  2. Open the Visual C# main_x64.csproj project file located in the <UnigineSDK>/source/csharp/apps/main_winform/D3D11SharpDXAppForm/ 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.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.
Notice
AppForm, AppFormControl, D3D11SharpAppForm are defined in the Unigine namespace.

See Also#

Last update: 03.02.2021
Build: ()