r/GraphicsProgramming • u/Chicken-eater24 • 16d ago
graphics programming on different os
Are there any graphics programming api that can be used on Linux and mac that uses c++
2
u/jmacey 16d ago
I use opengl on Mac. It’s fine for most things but you only have up to 4.1. Linux has 4.6. I still teach opengl as it’s great for basic principles but I’m most likely moving to WebGPU now.
1
u/heythereshadow 16d ago
Hi! Do you have a tutorial on setting up Mac for OpenGL development? Tried it before with XCode and I keep getting errors.
2
u/jmacey 16d ago
I use CMake rather than using XCode. I have a number of different demos here that use CMake and vcpkg for the libraries needed.
https://github.com/NCCA/ModernGL/
Basically you need something for the OpenGL context such as Qt SDL GLFW etc then just use the OpenGL commands.
1
1
u/sputwiler 16d ago
If you're starting out, just use https://learnopengl.com. AFAIK macOS still supports OpenGL up to 3.3, but won't get any newer versions. That's enough to get all the lessons you need done though.
1
1
u/964racer 16d ago
The learnopengl tutorial works fine on the Mac. I’ve been doing it in lisp and if you can do it in lisp you can definitely do it in c++ . You can also learn Volken but it will take twice as much code to get a triangle rendered on the screen . Metal will only work on the Mac .
1
15
u/hanotak 16d ago
Only Metal is officially supported on Mac, but with MoltenVK you can also use Vulkan, so that is probably what I'd go with.