Tutorial 1 (Creating an OpenGL Context)

Outline Many OpenGL tutorials start with something like “First install GLFW”, or “To start you will need a windowing library such as SDL”, or if you’re really unlucky, “Start by downloading Freeglut”. None of these are necessary (although if you insist on using one I recommend SFML which provides lots of nice features such as image/audio loading and has a very shallow learning curve). The one advantage these libraries offer you is that they tend to be extremely portable and will run across most platforms.

Read More

Tutorial 2 (Dealing With User Input)

Background When approaching this tutorial I hummed and hawed over whether it should build on Tutorial1 or not. Technically it has nothing to do with OpenGL, but user input is so closely tied to creating a window that in the end I decided that I would. Bearing that in mind the starting point for this tutorial more or less picks up at the end of Tutorial1. If you haven’t worked through it, then the source and Visual Studio project files for it are available on Bitbucket here.

Read More

Tutorial2.5 (An alternative method for user input)

Background In [Tutorial2]http://keithgrant.co.uk/tutorials/Tutorial2/ I outlined how to add basic input handling to an application, in particular one using the OpenGLContext from [Tutorial1]http://keithgrant.co.uk/tutorials/Tutorial1/. This method is fine and you can pass the event that is generated down into whatever you application you create very easily, the main loop would look something like: #!C++ while(my_app.run()) { // Process Inputs InputEvent e; while (test_window.popEvent(e)) { my_app->processInputs(e); } my_app->update(); my_app->draw(); } this is fine I suppose, but it does impose some restrictions.

Read More