Skip to content

Latest commit

 

History

History

1.6.SampleUnderWindows

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

Table of contents

This tutorial is part of OpenSceneGraph cross-platform guide.

In this tutorial we build and run sample OpenSceneGraph application under Windows. The application displays provided model with simple GLSL shaders.

Note: this tutorial requires

YouTube | Download

Video depicts running and building sample OpenSceneGraph application under 64-bit Windows 7.

Note: steps below use frames from the video as screenshots. Watch the video to see all details.

Screenshot

Get the latest copy of sample application with the following command:

git clone https://github.com/OGStudio/openscenegraph-cross-platform-guide-application.git

Screenshot

Create a separate build directory for sample application, just as you did for OpenSceneGraph.

Screenshot

Configure sample application build with the following commands:

cd /path/to/build/dir

cmake -G "MinGW Makefiles" /path/to/source/dir

Screenshot

Try to build application with the following command:

mingw32-make

Screenshot

Building process could not find one of OpenSceneGraph headers, because OpenSceneGraph is installed in a non-standard directory.

Screenshot

Locate OpenSceneGraph include directory and copy its path.

Screenshot

Reconfigure sample application build with the following command:

cmake -G "MinGW Makefiles" -DOSG_INC_DIR="C:\Program Files (x86)\OpenSceneGraph\include" /path/to/source/dir

Application's CMake file uses OSG_INC_DIR to search for additional headers.

Screenshot

Try to build application with the following command once again:

mingw32-make

Screenshot

Building process could not find OpenSceneGraph libraries, because OpenSceneGraph is installed in a non-standard directory.

Screenshot

Reconfigure sample application build with the following command:

cmake -G "MinGW Makefiles" -DOSG_INC_DIR="C:\Program Files (x86)\OpenSceneGraph\include" -DOSG_LIB_DIR="C:\Program Files (x86)\OpenSceneGraph\lib" /path/to/source/dir

Application's CMake file uses OSG_LIB_DIR to search for additional libraries.

Screenshot

Build sample application with the following command:

mingw32-make

Screenshot

Try to run sample application.

Screenshot

Sample application cannot be run, because it cannot find OpenSceneGraph libraries.

Screenshot

Copy osgPlugins directory and all files with dll extension to the directory, where sample application resides.

Note: you don't really need all OpenSceneGraph libraries. We copy all libraries just to keep this tutorial simpler.

Screenshot

Run sample application with the following command:

./sampleApplication /path/to/box.osgt