This page has been translated automatically.
Getting Started
Migrating to UNIGINE 2.0
C++ API Migration
UnigineScript
The Language
Core Library
Engine Library
Node-Related Classes
GUI-Related Classes
Plugins Library
High-Level Systems
Samples
Usage Examples
C++ API
API Reference
Usage Examples
C++ Plugins
注意! 这个版本的文档是过时的,因为它描述了一个较老的SDK版本!请切换到最新SDK版本的文档。
注意! 这个版本的文档描述了一个不再受支持的旧SDK版本!请升级到最新的SDK版本。

Unigine Integration into SDL Application

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

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

  • Create a simple SDL-based application
  • Integrate Unigine into the application
  • Initialize the OpenGL mode

Notice
The sample can be run on Windows and Linux only.
Notice
Only SDL version 1.2 is supported.

In this sample, the engine controls the main loop by itself: the doUpdate(), doRender() and doSwap() functions are overridden and call the update(), render() and swap() functions respectively.

Unigine integrated into the SDL application window

Running Sample

To run the sample, you should perform the following:

  1. Download development libraries from the SDL website.
    Notice
    Only SDL version 1.2 is supported.
  2. Extract the downloaded compressed folder and place it into the sample folder.
  3. Change the path to the SDL.h header file in the GLAppSDL.cpp if necessary. For example:
    Source code (C++)
    #include "SDL/include/SDL.h"
    						
    Notice
    By default, the SDL/SDL.h path is used.
  4. Prepare the development environment (according to the operating system used).
  5. Specify paths to the SDL/include/ and SDL/lib/x86 (or SDL/lib/x64) folders in your IDE.
  6. Rebuild the sample (see how to rebuild a sample application in Windows or Linux)
  7. Run the main.py script from the sample folder.

See Also

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