LearnOpenGL - Introduction (2024)

Since you came here you probably want to learn the inner workings of computer graphics and do all the stuff the cool kids do by yourself. Doing things by yourself is extremely fun and resourceful and gives you a great understanding of graphics programming. However, there are a few items that need to be taken into consideration before starting your journey.

Prerequisites

Since OpenGL is a graphics API and not a platform of its own, it requires a language to operate in and the language of choice is C++. Therefore a decent knowledge of the C++ programming language is required for these chapters. However, I will try to explain most of the concepts used, including advanced C++ topics where required so it is not required to be an expert in C++, but you should be able to write more than just a 'Hello World' program. If you don't have much experience with C++ I can recommend the free tutorials at www.learncpp.com.

Also, we will be using some math (linear algebra, geometry, and trigonometry) along the way and I will try to explain all the required concepts of the math required. However, I'm not a mathematician by heart so even though my explanations may be easy to understand, they will most likely be incomplete. So where necessary I will provide pointers to good resources that explain the material in a more complete fashion. Don't be scared about the mathematical knowledge required before starting your journey into OpenGL; almost all the concepts can be understood with a basic mathematical background and I will try to keep the mathematics to a minimum where possible. Most of the functionality doesn't even require you to understand all the math as long as you know how to use it.

Structure

LearnOpenGL is broken down into a number of general sections. Each section contains several chapters that each explain different concepts in large detail. Each of the chapters can be found at the menu to your left. The concepts are taught in a linear fashion (so it is advised to start from the top to the bottom, unless otherwise instructed) where each chapter explains the background theory and the practical aspects.

To make the concepts easier to follow, and give them some added structure, the book contains boxes, code blocks, color hints and function references.

Boxes

Green boxes encompasses some notes or useful features/hints about OpenGL or the subject at hand.Red boxes will contain warnings or other features you have to be extra careful with.

Code

You will find plenty of small pieces of code in the website that are located in dark-gray boxes with syntax-highlighted code as you can see below:

// This box contains code 

Since these provide only snippets of code, wherever necessary I will provide a link to the entire source code required for a given subject.

Color hints

Some words are displayed with a different color to make it extra clear these words portray a special meaning:

  • Definition: green words specify a definition i.e. an important aspect/name of something you're likely to hear more often.
  • Program structure: red words specify function names or class names.
  • Variables: blue words specify variables including all OpenGL constants.

OpenGL Function references

A particularly well appreciated feature of LearnOpenGL is the ability to review most of OpenGL's functions wherever they show up in the content. Whenever a function is found in the content that is documented at the website, the function will show up with a slightly noticeable underline. You can hover the mouse over the function and after a small interval, a pop-up window will show relevant information about this function including a nice overview of what the function actually does. Hover your mouse over glEnable to see it in action.

Now that you got a bit of a feel of the structure of the site, hop over to the Getting Started section to start your journey in OpenGL!

LearnOpenGL - Introduction (2024)

FAQs

What is the introduction of OpenGL? ›

OpenGL (Open Graphics Library) is a cross-platform, hardware-accelerated, language-independent, industrial standard API for producing 3D (including 2D) graphics. Modern computers have dedicated GPU (Graphics Processing Unit) with its own memory to speed up graphics rendering.

Is OpenGL being discontinued? ›

Active development of OpenGL was dropped in favor of the Vulkan API, released in 2016, and codenamed glNext during initial development. In 2017, Khronos Group announced that OpenGL ES would not have new versions and has since concentrated on development of Vulkan and other technologies.

What is the best language to use for OpenGL? ›

Since OpenGL is a graphics API and not a platform of its own, it requires a language to operate in and the language of choice is C++ .

Is OpenGL still used in games? ›

You bet! Many programs still use OpenGL to draw things. OpenGL has even been integrated into web browsers, a technique called WebGL. Many games also use OpenGL because of its wide support.

Is OpenGL written in C or C++? ›

The OpenGL libraries are written in C and allows for many derivations in other languages, but in its core it remains a C-library.

Why do people use OpenGL? ›

It is commonly used to make UI animations more responsive or to handle embedded video or to draw vector graphics – really any visual element you put on the screen is fair game for OpenGL. OpenGL is becoming increasingly ubiquitous and understanding how to leverage its incredible power is a must for developers.

What replaced OpenGL? ›

Vulkan is intended to provide a variety of advantages over other APIs as well as its predecessor, OpenGL. Vulkan offers lower overhead, more direct control over the GPU, and lower CPU usage.

Why did Apple deprecate OpenGL? ›

Apple lost interest in OpenCL after learning Khronos wasn't steering it into the direction they wanted it to go. For example, Metal compute shaders are C++14 and Khronos only adopted C++ in OpenCL after the beating they took from CUDA, which supported it since the beginning.

What modern games use OpenGL? ›

Games developed in OpenGL
  • Ballenger, a platformer.
  • Cube 2: Sauerbraten, an open source 3D FPS and also a game engine.
  • Doom (2016 video game), a FPS.
  • Minecraft, a famous sandbox video game.
  • Osu!, famous rhythm game.

Which is harder OpenGL or DirectX? ›

In terms of learning curve, both have a steep one but DirectX may be easier for beginners due to more documentation and tutorials. On the other hand, OpenGL may be more challenging due to less resources and more complexity.

Does Chrome use OpenGL? ›

Chrome uses ANGLE not only for WebGL, but also for its implementation of the 2D HTML5 canvas and for the graphics layer of the Google Native Client (which is OpenGL ES 2.0 compatible).

Do game engines use OpenGL? ›

A game engine uses APIs like OpenGL, DirectX, or Vulkan to perform the actual rendering. In short, you could say that OpenGL is a component that a game engine could use to accomplish its tasks. It's a tool in the toolkit of the larger, more complex game engine.

Why is Vulkan better than OpenGL? ›

Vulkan excels in creating work for the GPU spread over many CPU threads. If your application is targeting that, or already scaling well across CPU threads, and you have exhausted modern OpenGL techniques, then Vulkan can improve the situation. Off-screen GPU compute and graphics work.

Is OpenGL a CPU or GPU? ›

The architecture of OpenGL is based on a client-server model. An application program written to use the OpenGL API is the "client" and runs on the CPU. The implementation of the OpenGL graphics engine (including the GLSL shader programs you will write) is the "server" and runs on the GPU.

Does Nvidia use OpenGL? ›

NVIDIA supports OpenGL and a complete set of OpenGL extensions, designed to give you maximum performance on our GPUs. NVIDIA continues to support OpenGL as well through technical papers and our large set of examples on our NVIDIA Graphics SDK.

What is the use of learning OpenGL? ›

As I have already said, OpenGL is definitely something you will be required to learn if you want to be a graphics programmer. The API is simple and is based on general graphics concepts.

Is OpenGL is a programming language? ›

Welcome to the OpenGL Programming book. OpenGL is an API used for drawing 3D graphics. OpenGL is not a programming language; an OpenGL application is typically written in C or C++.

How does OpenGL work? ›

The architecture of OpenGL is based on a client-server model. An application program written to use the OpenGL API is the "client" and runs on the CPU. The implementation of the OpenGL graphics engine (including the GLSL shader programs you will write) is the "server" and runs on the GPU.

What is the function of OpenGL in computer graphics? ›

In order to make computer graphics from abstract to concreteness, OpenGL visual programming technology is widely used in our life. The illumination, material and atomization in OpenGL function are used to set up the triangular mesh model. OpenGL function is introduced to achieve the goal of rebuilding the object.

Top Articles
Latest Posts
Article information

Author: Saturnina Altenwerth DVM

Last Updated:

Views: 5400

Rating: 4.3 / 5 (44 voted)

Reviews: 83% of readers found this page helpful

Author information

Name: Saturnina Altenwerth DVM

Birthday: 1992-08-21

Address: Apt. 237 662 Haag Mills, East Verenaport, MO 57071-5493

Phone: +331850833384

Job: District Real-Estate Architect

Hobby: Skateboarding, Taxidermy, Air sports, Painting, Knife making, Letterboxing, Inline skating

Introduction: My name is Saturnina Altenwerth DVM, I am a witty, perfect, combative, beautiful, determined, fancy, determined person who loves writing and wants to share my knowledge and understanding with you.