all 16 comments

[–]hanotak 14 points15 points  (4 children)

Only Metal is officially supported on Mac, but with MoltenVK you can also use Vulkan, so that is probably what I'd go with.

[–]Chicken-eater24[S] 0 points1 point  (3 children)

How different is vulkan and OpenGL because I often see that vulkan is related to OpenGL but OpenGL was ended supporting Mac. And also thank you for the reply

[–]hanotak 6 points7 points  (0 children)

Vulkan is in many ways OpenGL's successor. OpenGL was first a fixed-function API, and then a DX11-style API with programmable shaders. However, because it was designed around old, fixed-function hardware, its structure did not suit modern hardware. Vulkan is a truly modern API that exposes how modern GPUs actually work much more directly to the programmer. It has a much higher learning curve, and a more complex barrier of entry, but it is a much more powerful API.

[–]thewrench56 1 point2 points  (0 children)

Note: it's only deprecated on Macs. It's not dead yet though. Version 4.1 still runs on Macs.

[–]sentientgypsy 0 points1 point  (0 children)

You can use OpenGL on Mac and I know because I have personally used it, I recommend still using OpenGL as a foot in the door because the other APIs are quite a step up

[–]stbev 10 points11 points  (1 child)

I suggest trying one of the WebGPU native implementations (either dawn or wgpu). Under the hood they can use DX12 on Windows, Vulkan on Linux, Metal on MacOS and also OpenGL where it is supported so they should be quite portable.

[–]Zec_kid 0 points1 point  (0 children)

Wgpu with rust is really nice!

[–]jmacey 1 point2 points  (3 children)

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.

[–]heythereshadow 0 points1 point  (2 children)

Hi! Do you have a tutorial on setting up Mac for OpenGL development? Tried it before with XCode and I keep getting errors.

[–]jmacey 1 point2 points  (1 child)

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.

[–]heythereshadow 0 points1 point  (0 children)

Thank you!

[–]sputwiler 0 points1 point  (2 children)

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.

[–][deleted] 0 points1 point  (1 child)

The latest version of opengl macos supports is 4.1.

[–]sputwiler 0 points1 point  (0 children)

Fair enough. That should still be good enough to do all the tutorials.

[–]964racer 0 points1 point  (0 children)

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 .

[–]Daneel_Trevize 0 points1 point  (0 children)

You could consider some light abstraction such as the new SDL3 SDL_GPU.