This page has been translated automatically.
UnigineScript
The Language
Core Library
Engine Library
Node-Related Classes
GUI-Related Classes
Plugins Library
High-Level Systems
Samples
C++ API
API Reference
Usage Examples
C++ Plugins
Content Creation
Materials
Unigine Material Library
Tutorials
Warning! This version of documentation is OUTDATED, as it describes an older SDK version! Please switch to the documentation for the latest SDK version.
Warning! This version of documentation describes an old SDK version which is no longer supported! Please upgrade to the latest SDK version.

Unigine Integration into MFC Application

This article describes the sample located in the <UnigineSDK>/source/samples/App/D3D9AppMFC/ folder.

The sample demonstrates how to embed Unigine into MFC-based application, namely:

  • Create a simple MFC-based desktop application for Windows
  • Integrate Unigine into the application
  • Initialize the DirectX 9 mode
Notice
The sample can be run on Windows only.
Notice
MFC Windows libraries are located in the <UnigineSDK>/source/samples/App/D3D9AppMFC/lib/ folder.

In this sample, the MFC application controls the main loop: it calls the D3D9AppMFC::OnIdle() function defined in the D3D9AppMFC.cpp when the message queue of the application is empty. The D3D9AppMFC::OnIdle() function in turn calls the engine update(), render() and swap() functions.

Unigine integrated into the MFC application window

Running Sample

To run the sample, you should perform the following:

  1. Prepare the development environment.
  2. Run the main.py script from the current folder.

See Also

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