Before we continue, let’s discuss something about GLUT and Codeblocks.
Here we use FreeGLUT instead of the original GLUT written by Mark Kilgard. FreeGLUT is an open source alternative to the OpenGL Utility Toolkit (GLUT) library with a free software license. FreeGLUT allows us to create and manage windows containing OpenGL contexts on a wide range of platforms and also read the mouse, keyboard, and joystick functions.
Codeblocks is a free C++ IDE that is extensible and configurable. Codeblocks can be extended with plug-in DLLs and even you can compile your own plug-ins.
Before we begin to set up, let’s prepare some packages that need to be installed beforehand.
Install Codeblocks
- On Fedora
sudo dnf install codeblocks
- On Ubuntu
sudo apt install codeblocks
Install FreeGLUT
- On Fedora
sudo dnf install freeglut-devel
- On Ubuntu
sudo apt install freeglut3-dev
Set up GLUT in Codeblocks
- Open Codeblocks
- Go to Settings -> Global variables…
- Under Current variable , click New and create glut variable
- Fill in each field as shown below, and click Close when finish
- On Ubuntu
- On Fedora
Let’s try to create a new project
- Open the project wizard
- Create a “HelloWorld” Project
- Use glut global variable
- Leave the default compiler configuration as it is and then click Finish
- A demo project will be created as shown in below
- Run the demo project, and we’ll see this wonderful objects
Photo by Olia Gozha on Unsplash
Top comments (0)