Skip to content

Want the Ultimate Guide to Easily Learning OpenGL in C++? Here It Is.

Photo by Beuc on WikiMedia

Learn to learn code faster, using techniques honed by years of study, neatly packaged into one book: How to Learn Code

Getting started in Graphics programming is no easy feat. It requires a type of persistence and patience which is rare amongst humans. In addition, the documentation and learning resources are not ordered like in a university course or a Udemy course.

On the internet, graphics programming resources are scattered and hardly mainstream. It is impossible to know whether or not a C++ tutorial is good until you get halfway through.

This is why I am here, to point the way for you as a potential graphics programmer.

Choose an IDE

First things first. You have to get comfortable. If you like CLion, stick to CLion, if you like VS Code stick to VS Code. Visual Studio, fine. The point is, choose whatever you will be most productive in. Do not cater to the build tool and IDE unless it is standard with a game engine or required by a community.

For your own edification and personal projects its best to stay as productive as possible in your own environment.

Build Tools

The hardest part about choosing an IDE to program in, is building dependencies into C++ and OpenGL. In fact, learning to easily include dependencies into a C++ source should be the first thing you learn.

You will find this is a lot harder than other languages. Deciding to tackle this issue first will save you TONS of time and effort later in your graphics programming journey.

The big secret to managing dependencies is to use a build tool. Perhaps the best and most intuitive is vcpkg by Microsoft. I highly recommend looking up a tutorial for vcpkg and practicing adding dependencies and removing them.

Using vcpkg is different per IDE. You definitely want to add this to your repertoire of C++ skills in your chosen IDE. You will have to use the visual studio tool chain and link the vcpkg build tool to it.

This can take you many hours to figure out, but once you have it, an entire repository of C++ libraries will become available to you and you will be ready to go.

Think of it like a much harder pip for python, gradle for Java or npm for Node.js

CMake Is King

Find a Udemy course or an entire YouTube series on learning CMake. It is worth the investment and you will find all sorts of open-source projects suddenly become available to you.

CMake is a C++ standard. Everything I am listing here before even learning graphics programming are required essentials to unlocking the power of C++ for all things, not just graphics programming. But yes, this amplifies your ability to code OpenGL.

Get as far as you can with CMake in these tutorials. Open source game engines, C++ video games, embedded systems, compilers and many other types of code sources use CMake as their build tool.

You will forever be able to use these systems, so learn it and enjoy the power you get from it. Oh and also, vcpkg uses CMake, so you are actually getting more power and synergy from learning both.

Finally, Graphics Programming

Okay, here is the basic plan…

  1. learnopengl.com: Your initial goals should be to first finish the introduction and create a triangle, window and install libraries. Your final goal should be to finish EVERY project on the website and practice, keep notes and read everything. In addition, you need to learn to become OpenGL extension agnostic, meaning you should be able to switch between GLAD, GLEW, GLFW, SDL, GLUT with no problems. Once you complete this you are good to go.
  2. Real-time rendering textbook: After that read this book. Its the best book on introducing graphics programming. It will make you more Graphics API agnostic. Meaning you will better be able to switch between graphics programming APIs like OpenGL, WebGL, DirectX 11 etc.-

*At the same time do these:

  1. Attend a graphics programming meetup and allow yourself to be influenced by professional graphics programmers.
  2. Send the OpenGL specification to your Kindle app as a PDF and while waiting around places or traveling read it. The goal should be to learn the terminology.
  3. Send the OpenGL Shader specification to your kindle app as a PDF and also learn the terminology.

At the End the Initial Hurdle Should Be Over

Once all this is done you would be introduced to the graphics programming scene. You should be able to start continuing on your journey with the basics in tact.

Anywho, I hope you learned something…

Happy coding!

Resources

learnopengl monolithic course: https://learnopengl.com/

OpenGL specification: https://registry.khronos.org/OpenGL/specs/gl/glspec46.core.pdf

OpenGL shader specfication: https://registry.khronos.org/OpenGL/specs/gl/GLSLangSpec.4.60.pdf

“Real-Time Rendering” book: https://a.co/d/fzjWqpK

CMake build tool: https://cmake.org/

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Posts

What is a loop?

When coding it is common to need to repeat lines of code. Loops help us do this in mass for all our coding needs. You

Read More »

Search this blog

Generic selectors
Exact matches only
Search in title
Search in content
Post Type Selectors

Newsletter

Subscribe now to get my library of freebies + weekly emails with coding, tips for learning, and resource tips.

Learn to learn code faster, using techniques honed by years of study, neatly packaged into one book: How to Learn Code

Top content