Help end child hunger

Code Samples

Prev: Error Tracking in OpenGL Next: Working with Core OpenGL in WX Wigets

Lighthouse3D code samples are provided for learning purposes only. Some code could be severely optimised, but I tried to keep it as simple and clear as possible.

The code comes with no warranties, use it at your own risk. You may use it, or parts of it, wherever you want.

If you do use it I would love to hear about it. Just post a comment in the respective sample.

Two triangles

This is a simple, yet complete, code sample to draw two triangles using OpenGL 3.3 and GLSL 1.5. As far as I know the sample does not use any deprecated functions.

The sample covers Vertex Objects, Vertex Array Objects, Uniform and Attribute variables, shader setting, and definition of the camera and perspective matrices.

Model Loading

This is a OpenGL 3.3 + GLSL 3.3 sample that loads and displays a 3D model with Assimp 3.0. It also uses DevIL in case the model has textures. It was based on Assimps OpenGL demo and it extends it to support OpenGL 3.3

The sample uses Texturing, Vertex Array Objects, and Uniform Blocks. Camera can move around the object using the mouse, and the mousewheel can be used to zoom on the model, courtesy of freeglut.

testTexture From Image – with the DevIL API

OpenGL, unlike Direct3D, is independent of the operating system. While this eases the portability among different OS, it implies that we have to resort to external libraries for a number of tasks, loading images being one of the most used.

In this short tutorial we will use DevIL, an external image loader, to load an image from a file, and use this data to create an OpenGL texture.


Prev: Error Tracking in OpenGL Next: Working with Core OpenGL in WX Wigets
© 2014 Suffusion theme by Sayontan Sinha