Updating older bottom brackets
Download the needed Files, extract them and place them in our project in the same directory that holds the file (in our example it's C:/pong/pong/).Our project directory should then look like this: 2.Include Open GL and GLUT (and a few more things) at the top of our source code like this: This is the program entry point, which is just the first thing that happens when we run it.We want to see more than a console popping up for a second, so let's create the Open GL window.At first we will declare two score variables just where we declared our window width and height variables.We will have one score for the left player (the one with the left racket) and one for the right player (the one with the right racket): The code draws the text at the position (x, y).
The last step is to enter a project name and the location where it should be saved: After pressing OK a new window appears where we press Finish. We see the file right in front of us like this: If we press F5 (or the green play button), the project should compile fine and a black console window should pop up for a second or so.But in the background, update and draw are already called all the time (about 60 times per second). We want to make a 2D game, so obviously we have to tell Open GL that.We will create a new enable2D function that will do all the Open GL configurations that are needed in order to let things appear in 2D.This tutorial shows how to make a C pong game in the easiest way possible.The end result are about 150 lines of code in a single source file without any complicated project-, linker- or compiler settings.