OpenGL Demo Template

29 November 2003

opengl_demotemplate_small

Description

This is my latest OpenGL template code, written in C for speed and simplicity. It uses native X and Win32 calls for window management, thus requiring only OpenGL for operation (no GLUT, SDL, etc needed) and only the OpenGL headers and libs and GLU for compiling.

Features

  • Mesh loading from 3dsmax 3DS format. Also loads:
    • Object material ambient, diffuse, and specular parameters as the corresponding OpenGL material params
    • Object material diffuse map as primary texture
  • ARB_vertex_program and ARB_fragment_program support
  • Mesh data automatically stored in hardware buffers (ARB_vertex_buffer_object) if possible
  • Compiles in linux (gcc 2.95 / 3.3 tested) and Windows (MSVC 6 tested).

TODO

  • Mesh animation
  • Sort the rendering loop by material/etc to minimize state changes
  • Loading a 3DS mesh without a diffuse map will cause a crash

Download

Source:

Binary executable: