6 comments

  • the__alchemist 17 minutes ago
    In 2026: Please don't learn this; it's obsolete. Learn Vulkan (Or another modern API; or how to build engines on top of them; or how to write shaders; or how to do GPU compute using CUDA etc)
    • samiv 16 minutes ago
      OpenGL is not obsolete and is totally fine for many use cases. Vulkan is way too complicated and cumbersome for many.

      Even if OpenGL doesn't get new features what exists now will continue to work for decades.

      • hmry 0 minutes ago
        I do agree Vulkan is too cumbersome, but OpenGL is definitely obsolete.

        The OpenGL API with its binding-based approach is also very confusing for beginners, but the replacement Direct State Access API came too late (after Apple already decided they would deprecate OpenGL, so it never got supported on macOS).

        And the fact that the GLSL parser and compiler are part of the driver means there are tons of hardware-specific bugs and miscompilations. Intel integrated drivers on Windows are notorious for being especially buggy.

        All of those make OpenGL a pretty poor target for learning. Personally, I would recommend WebGPU to people who want to get into graphics programming. It's very similar to DirectX/Metal, and like a more streamlined Vulkan. WGPU has a C API, which also has C++ headers, and a native Rust API. And you can also use WebGPU from JavaScript, if you don't know any native languages.

      • flohofwoe 11 minutes ago
        The problem with OpenGL isn't so much that its programming model is outdated, but that it is an incredibly confusing and (in many places) just plain badly designed API (just look at VAOs, it's hard to come up with a more broken and useless feature - some of the problems have been salvaged on more recent OpenGL versions, but those are not portable to macOS or GLES3.x).

        Another (related) problem is that the many sediment layers that have accumulated over nearly three decades are not clearly separated (and Vulkan is starting to suffer from the same problem btw, there's always at least five different ways to do the same thing, three of which are outdated or not recommended to be used on specific GPU architectures, and the other two have complicated relationships and interdependencies with other redundant or optional features, it's apparently some sort of Khronos curse to always create the biggest possible mess when it comes to 3D APIs).

        On Windows, starting with D3D11 makes a lot more sense, or on macOS with Metal v1. Both APIs are 'close enough' to modern 3D APIs to carry a lot of the knowledge over, but without being too low-level like Vulkan or D3D12.

      • reactordev 14 minutes ago
        Sadly, the OP is right, OpenGL is deprecated on a number of platforms and down right removed from others. Please don't learn this now. Vulkan has the shape of every modern graphics api out there, DX included. Learn this or at the very least WebGPU.
    • PcChip 5 minutes ago
      OpenGL works fine, I'm using it in my hobby game engine (shaders, not the old fixed-function OpenGL)

      it also will run just fine on windows or Linux using Proton with no issues

      if I had to learn Vulkan from scratch instead, that would have been a whole different animal...

    • criddell 14 minutes ago
      It's so much easier than Vulkan or writing shaders and the performance is more than good enough for a lot of applications.

      I wonder if somebody has written a adapter layer to write old OpenGL and translate it on the fly to Vulkan?

      • flohofwoe 0 minutes ago
        > write old OpenGL and translate it on the fly to Vulkan

        Apple's OpenGL on macOS and iOS has been a shim over Metal for a very long time. The feature set is stuck somewhere between GL 3.x and 4.1 (e.g. no compute shaders), but not for technical reasons.

      • hmry 7 minutes ago
        Mesa has Zink which translates OpenGL to Vulkan. AFAIK Asahi uses it because they only wrote a native Vulkan driver for the hardware, no native OpenGL driver.

        Apple themselves also doesn't ship a native OpenGL driver anymore, only a layer that translates OpenGL to Metal.

  • MoltenMan 41 minutes ago
    Man, this takes me back! I made a Minecraft clone called Mindacraft in Java using LWJGL (the same framework Minecraft uses) about 6 or 7 years ago using this tutorial. I vividly remember this tutorial being the most useful resource for OpenGL by an order of magnitude, and that was with it being written in a language that actually had pointers and buffers! (Using OpenGL in Java is very weird because you have to use pointers and buffers through a bunch of wrapper classes, and it makes things a lot weirder. It's like using unsafe in Rust if unsafe wasn't even in Rust).
  • AyanamiKaine 40 minutes ago
    If you want to use the learned knowledge I would recommend to use something like Sokol [0] or use the SDL-GPU API [1]. While Sokol is more higher level both can be used. Otherwise learn opengl is a really good introduction.

    [0] https://github.com/floooh/sokol [1] https://wiki.libsdl.org/SDL3/CategoryGPU

  • brcmthrowaway 6 minutes ago
    The old primitive API was the best. Who invented the new shader API? They ruined my life.
  • AspisAiantos 42 minutes ago
    I've gotten through the Getting Started section and found it to be quite good overall. A few times it seems to make some jumps back and forth between slightly different setups, which might lead to some problems debugging.

    I definitely recommend it to anyone interested! Honestly one of the biggest things it helps with is explaining the setup boilerplate for OpenGL.

  • SomeHacker44 40 minutes ago
    Any recommendations on how to use OpenGL from the CLR (.Net/C#) please?
    • Sleaker 28 minutes ago
      Typically just find bindings for your language and adapt the startup/bootstrap to match your language syntax. Opengl calls are fairly agnostic especially when you move to the shader logic.

      The biggest issue with c# dev is OS specific window management. CLR doesn't have good wayland support yet if you're trying to do this from a modern Linux distro.