ITCS 6127 SDKs

Zachary Wartell

Revision 1.0

Assumptions

  1. Microsoft (MS) Windowsstudents are using MSVS 2005.

SDKs

We will use the following APIs: OpenGL, GLEE, SDL, Collada DOM. Additionally there are several tools and example applications associated with these libraries that will be useful.

For the course’s SDKs’ libraries, I give additional instructions when need to make sure the SDKs work together and compile with the example code given on the course website[i].

  1. OpenGL – cross-platform graphics
    On MS Windows:
  2. OpenGL (GL) is provided with MSVS 2005, but to use features beyond GL version 1.4 you need GLEE.
  1. GLEE – cross-platform library for programming with modern OpenGL versions (beyond 1.4) OpenGL extensions. elf-stone.com/glee.php
    On MS Windows:
  2. Grab the GLEE package from the class website.[ii]
  3. Open and compile library from glee.sln
  4. Create a user environment variable GLEE_DIR and set it to the path where you put the GLEE directory. For me this was:
    E:\Users\Zachary\Documents\Career\research\libraries\glee
  1. SDL – “cross-platform multimedia library designed to provide low level access to audio, keyboard, mouse, joystick, 3D hardware via OpenGL, and 2D video framebuffer.” at
    On MS Windows:
  2. Download and install the Direct X SDK.[iv]
    (Note, installation automatically create a user environment variable DXSDK_DIR and sets it to the path where the DirectX SDK is installed).
  3. Download SDL source code and place in a directory named:
    SDL
  4. Follow instructions in SDL\VisualC.htmlbut see my following alterations and comments:
  5. After unzippingSDL\VisualC.zipyour files should be organized like:
    SDL\VisualC.html
    SDL\VisualC\SDL.sln,
    …etc.[v]

Compiling SDL:

  1. Open SDL\VisualC\SDL.sln
  2. On “SDL Property Page” dialog, add to the 'Configuration Properties:C/C++:General:Additional Include Directories' the path to the DirectX SDK .h files. For example:
    $(DXSDK_DIR)\include
  3. On “SDL Property Page”, add to the 'Configuration Properties:Linker:General:Additional Library Directories' the path to the Direct X SDK .lib files. For example:
    $(DXSDK)\Lib\x86
  4. On “SDL Property Page” dialog, open the “Configuration Manager”. change “Configuration Properties:C/C++:Code Generation:Runtime Library” to “Multi-threaded Debug DLL (/MDd)”. [vi]
  5. On “SDLmain Property Page” dialog, change “Configuration Properties:C/C++:Code Generation:Runtime Library” to “Multi-threaded Debug DLL (/MDd)”
  6. Now compile both SDL projects.

“Install” and Test SDL

  1. Create a user environment variable, SDL_DIR, and set it to the full path your SDLdirectory.
  2. To test things, open SDL\VisualC\tests\tests.slnand compile and run the Project testgl. But first modify the testgl project as follows:
  3. change the Runtime Library to “Multi-threaded Debug DLL (/MDd)” first.
  4. set 'Configuration Properties:Debugging:Environment' to:
    PATH=%SDL_DIR%\VisualC\SDL\Debug;%PATH%
  1. COLLADADOM– is XML based file format designed for interchanging 3D digital content between different digital content creation tools. Collada file name extension is .dae. Collada is a growing industry standard so it should be able to find .dae files on-line or exportto .daefrom your favorite 3D modeling. We will use the Collada DOM library for reading in 3D models and a number of Collada based tools for processing .daefiles.
    The Collada DOM user guide describes how to download the libraries and compile you application using them. The DOM user programming guide is at:

The DOM library loads .daefiles and creates in memory C++ objects from a C++ class hierarchy. The class hierarchy closely corresponds to Collada’s XML schema. The DOM library includes documentation on the C++ classes but it may be useful to glance at the Collada XML specifications since they source of the C++ classes. The Collada XML specs are found here:
The Web is full of Collada model’s here are some links:

On MS Windows:
The user guide describes how to get and compile the DOM library. Additionally under Windows, you should create a user environment variable called COLLADA_DOM_LOCATION that points to the path to the directory where you installed the DOM library.

Tools

  1. Collada Refinery- The Collada Refinery is a GUI based application for performing various file transformations on .daefiles. For our purposes the primary useful file transformations (called ‘conditioners’) are the following ‘geometry processing’ ones
  2. polylists2triangles – this triangulates all polygons into triangles
  3. deindexer – reorganizes multi-indices into single-indices suitable for OpenGL

Use the Refinery to process any 3D models you want to work with into versions that are triangulated and deindexed This will greatly simplify write code to load and render the .daefiles.

Links for the Refinery are:

  • - documentation
  • - download. Just download the installer. No need to get source and compile, etc.

Footnotes

[i] For all MS Windows compilation of course examples and open source libraries, I assume: (1) Executables and libraries are compiled consistently using the Multi-threaded Debug DLL version of the C run-time library; (2) Paths to any compiled open source DLLs are found at run-time by MSVS 2005 by having set the PATH environment variable in the Project settings ‘Configuration Properties:Debugging: Environment’ so that PATH includes all necessary directories to the compiled open source libraries; (3) For each SDK, an environment variable is created pointing to the SDK’s installation directory.

[ii] Circa 1/29/08 the official GLEE distribution contains no .sln file and while it contains a precompiled windows binary, the binary gave me linking problems under MSVS 2005. Hence, I recommend compiling it yourself.

[iii] I used SDL version 1.2.13

[iv] This could take some time. E.g. DirectX 10 SDK was 500MB!

[v] Instructions in VisualC.html seem confusing. They seem to imply you should end up with file organization like SDL\VisualC.html, SDL\SDL.sln, SDL\SDL.dsw, etc. which doesn’t compile.

[vi] By default SDL’s Debug Configuration uses the non-debug Runtime Library (Multi-threaded DLL /MD). Most other libraries, however, use the Debug version of the Runtime Library for the Debug compilation of the library. Trouble will occur when you try to link two Debug libraries (such as SDL and GLEE) that used different Run-time libraries. To avoid this problem, we switch SDL Debug configuration to use the debug Runtime library.