3D OpenGL Game DevLog #1

Hello and welcome to the first devlog on my upcoming game. In this series I will share what I learned and how you can prevent my mistakes, you can also see this series as a tutorial on how to make my game yourself! (Every software I used is free). I have also made a tutorial on how to set up your Visual Studio 2019 for use with C++ and OpenGL if you’re interested in following this devlog series as a tutorial.

Day 1 - Learning OpenGL

At first, OpenGL looked very hard, but I learned that if I push through the hard bits, the rest is a piece of cake! Luckily I found this website which taught me a LOT. This is what I’ve learned. GLUT is a window manager library for OpenGL, so you don’t have to do the hard work of opening a window yourself, this is one of the few times I’m going to use an external library to do something since I like full control over my code. The reason we use an external library for this is because it is a pain in the backside to open a window and it is always the same so why bother going through the process of making something that already exists. In my Game.cpp file, I added:

#include <GL/glew.h>
#include <GL/freeglut.h>

void render(void) {

    // Do rendering of objects here


int main(int argc, char** argv) {
    glutInit(&argc, argv);
    glutInitWindowSize(1280, 720);
    glutInitWindowPosition(200, 200);
    glutCreateWindow("Some random game");

    glClearColor(0.145, 0.6, 0.388, 1);

    return 0;

int main(...) Is the entry point for our game, code will start running here.
glutInit(...) Starts the "engine" (like a car) of GLUT.
glutInitDisplayMode(GLUT_SINGLE) Sets the window to Single Buffer Mode and does some magic (I also have no idea :P).
glutInitWindowSize(1280,720) Sets the window resolution to 1280x720 (the 720p standard).
glutInitWindowPosition You guessed it (I think), it sets the window's position on the screen.
glutCreateWindow(...) Creates the window on the screen with the given settings and name.
glewInit() Starts the "engine" of OpenGL.
glClearColor(...) Sets the COLOR_BUFFER_BIT to the given color. It is basically just the background color.
glutDisplayFunc(render) This is the function that gets called everytime OpenGL wants to draw a frame to the screen, we set it to render().
glutMainLoop() Starts the main loop that keeps on running through the entire game.
In the render() method:
glClear(...) Clears the screen and fills it with the background color.
glutSwapBuffers() Applies any drawn objects to the screen.

If you are thinking like: what in heaven’s name is this dude talking about? Don’t worry, you will almost never have to touch this code again. If we now start our game, after loading for a couple seconds, we will see our newborn child. A beautiful green screen with a beautiful name: “Some random game”. Lovely, isn’t it?