In the world of gaming, SDL provides the entire necessary infrastructure. This would have become clear from previous articles in this series. Infrastructure is to a game what a skeleton is to a human body. But without muscles, no locomotion is possible. So working with the body analogy, SDL provides the skeletal structure to build the game whereas the flesh, blood and skin are provided by 2D and 3D graphics libraries.
In the current plethora of 3D libraries, OpenGL stands out for various reasons. The most significant of these is its compatibility with almost all platforms and graphics cards. This is reflected even in the architecture of SDL as SDL can create and use OpenGL contexts on several platforms. Such architecture helps the game programmer to use all the sub-systems of SDL seamlessly in conjunction with OpenGL to provide the most effective games and gaming environments.
In this article I will discuss how to use SDL and OpenGL together, with the gaming infrastructure provided by SDL, and animation as well as rendering being handled by OpenGL. The first section will detail the whys and wherefores of OpenGL. The second section will discuss the steps required to integrate OpenGL with SDL. The third section will utilize the pointers provided in the second section to create an application having some basic animation using OpenGL. That is the agenda for the current discussion.
If you wish to refresh your memory with previous articles in the series, they can be found at the following links: