The Language
Core Library
Engine Library
Node-Related Classes
GUI-Related Classes
Plugins Library
High-Level Systems
API Reference
Usage Examples
C++ Plugins
Content Creation
Unigine Material Library

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
The sample can be run on Windows only.
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