RSSAmplifier

Blog

Diego Macario

A blog about the fundamentals of computer graphics, and how they can be used to create cool interactive experiences. Stick around to learn how you can use C++, OpenGL and linear algebra to program creatively.

diegomacario.github.ioRSS feed ↗4 posts

Latest posts

The Hitchcock scene that nobody talks about

A few years ago, on a day when I was very sick in bed, I stumbled upon a movie called Rear Window on Netflix. I had never watched a Hitchcock movie before then, so I decided to give it a shot. What followed was the greatest cinematic experience I have ever had. I don’t know why, but as I watched that movie I felt transported into its world. Perhaps it was because the main character is stuck at…

My favourite paragraph

My favourite paragraph was written by Viktor Frankl in his book Man’s Search for Meaning. For context, Viktor Frankl was an Austrian psychiatrist who spent three years imprisoned in four different concentration camps during the Second World War. Here are the words he used to describe how he felt after being liberated:

How to keep the aspect ratio of an OpenGL window constant when it’s resized

Something that I had a hard time figuring out when I started working with OpenGL is how to keep the aspect ratio of a window constant when it’s resized. For some reason I couldn’t find information about that topic anywhere. Hopefully this post will help you if you are as lost as I was back then.

Always remember to disable the copying of classes that wrap OpenGL objects

One thing that really surprised me when I started working with OpenGL is that when you write a class that wraps an OpenGL object, you should never make a copy of an instance of that class. To understand why, consider this example: