Common code

This page describes reusable code, not demos.


These files are needed for ALL demos! (Well, at least some parts are used over and over.) They are also the base of my lab materials in my courses. What I wanted to do here is a package that is transparent, easy to read and modify. No big do-everything packages spread over hundreds of files. Just a small number of to-the-point solutions of the most common problems.


This package includes:

MicroGlut, a single file GLUT replacement with the essentials and no old OpenGL dependencies, available for Linux, OSX and Windows.

VectorUtils3, a fairly capable vector/matrix package.

loadobj, a model loader that loads a subset of the Wavefront OBJ format. (Parts written by Mikael Kalms.) This file will be replaced by LittleObjLoader.c!

GL_Utilities, shader loader and more.

LoadTGA, loader for TGA images (simple lab-friendly image format). LoadTexture, below, is more capable, but LoadTGA will remain as a separate file for keeping the core core brief and understandable.


Download:


common.tar.gz (updated 2017-09-13)


common-170419.tar.gz (previous version)


Additional files:


The following two files are enhanced versions of loadobj and LoadTGA, both written 2019.


Little OBJ loader is a largely rewritten new version of loadobj, simplified, easier to read, but most importantly much more capable than the old one! It can now load multi-part models with .mat files! I have tested it on a considerable number of OBJ files and it performs a lot better than loadobj, loading most models correctly complete with the .mat files.


LoadTexture is a simpler, but as far as I can tell also useful package, combining four image loaders so you can load PPM, TGA, PNG and JPG with one single call, with minimal dependencies.


These are the very first versions, so we should consider them preliminary at this time. They have, however, performed well in my tests so I believe they can be useful.


Links to pages with download links:

Little OBJ Loader

LoadTexture




This page is maintained by Ingemar Ragnemalm.