OpenGL on future iPhones and Macs?

Hello everyone! After some time to think about I proceed with graphics api, I figured opengl will be my first since I'm completely new to graphics programming. As in my last post you may find, I was speaking on moltenvk and might just use metal instead, along with the demos I found using metal. So for now, and I know this is said MANY TIMES, apple deprecated opengl but wish to use it because I'm new to graphics programming and want to develop an app(a rendering engine really) for the iPhone 14 Pro Max and macOS Ventura 13.2(I think this is the latest). So what do you guys think? Can I still use opengl es on the 14 max, along with opengl 4+ on latest macOS even though is deprecated?

Replies

I have difficulty imagining a better API to start learning graphics programming than Metal. It's streamlined, compact, has very little conceptual overhead and should be familiar to anyone who knows some C++. There are plenty of good tutorials around and you can focus on important things instead of fighting the API. Also, learning Metal will also teach you the best practices of programming modern GPUs. Vulkan and DX12 are both much more complex and idiosyncratic, both in the API surface and the mental model. If you are familiar with structs and pointers, you already understand the Metal resource binding model. With other APIs you have to learn opaque multi-level concepts full of weird limitations and awkward glue.

And OpenGL? Why would you waste your time with a morally obsolete API? Sure, ancient GL with its immediate mode and fixed function can appear simpler, but GPU programming has moved beyond this many years ago. If you really want to learn modern GPU programming you might as well actually learn modern GPU programming.

  • So, metal is what you had in mind? I'm using C++ to do graphic programming

  • What modern gpu do you suggest for first time graphic programmers?

  • The question is about whether OpenGL works or not. If you have no clue - do not post garbage. OpenGL is still the best cross-platform and easy to learn. Your opinion is a complete BS.

Add a Comment

I remember your previous thread. Based on that, I can’t understand why you are now considering using OpenGL.

Do you care about portability to other platforms, or the web?

  • The reason I(might)consider opengl is because I'm new to graphics programming. And as for portability, I care deeply because it's what I want.

  • I care deeply about portability. I haven't started my engine yet because I'm too much of a beginner to figure out the rendering api, and since I never started, I figured opengl will be first

Add a Comment

I thought you guys got my comments but I guess not. I'm completely new to graphics programming(metal, vulkan, even dx12) and still doing research before I begin. I was told to do opengl since I'm new to the api graphics programming, and it was said MANY times to do opengl if your completely new. As for portability, I care deeply about it. I want to reach audiences by different platforms such as iphones(there are those who game on these devices). I'm not new to C++, just new to vulkan and metal is all

I was told to do opengl since I'm new to the api graphics programming, and it was said MANY times to do opengl if your completely new.

Not by us in your previous thread. Who exactly has suggested that to you? Is it something that you've read on an old website, maybe? Right now, I think most people would tell you that you must learn most of the APIs (Metal, Vulkan, and DirectX, and maybe WebGL) to create a portable application - unless you use a higher-level system like Unity.

As I wrote previously, I think in another year or two WebGPU will be the "start here" API for portable 3D - and not only for web apps, thanks to native webgpu.h. I hesitate to say that WebGPU is what you should learn today - because it's much less mature than the alternatives, and learning materials are thin on the ground. And I could be wrong about its rosy future!

So WebGL or WebGPU is what I need to learn, then go to metal?

I did get your comment. And I am saying that learning OpenGL in 2023 is a waste of your time. Metal is the simplest modern GPU API currently on the market and is very suitable to learning 3D graphics programming for a beginner. So if you own a Mac and want to learn desktop GPU programming, it's pretty much a no-brainer. Once you understand the ropes you can very easily graduate to less user-friendly APIs like Vulkan or DirectX.

If you want to make web applications instead, WebGL is the way to go.

I'd suppose. But where do I learn metal? I'm C++ all the way and don't wish to touch swift at all(I'm ok with objective-c since I can bridge my c++ to it). Also, if I learn metal first, can I go to directx 12 or vulkan after learning metal?

  • Look at 2etime’s YouTube channel. There should be enough there to get you going and then some.

    edit: the programming language should not matter much, but if you insist, I do think that I have seen C++ tutorials on YouTube as well.

  • AI can help you learn, you can ask chatGPT to act as a metal developer and help you write your app with full explanation of it. Give it a really good description of your app and what you want it to do, what UI panels and their functionalities, etc. Doesn't hurt to see what the response is. I just made a complete 2d game in unity with only using AI to create the scripts, it even told me where to place them on what game objects. Pretty Cool.

  • It would be awesome if apple could implement their own version of this with the metal SDK :P

Add a Comment

Look at 2etime’s YouTube channel. There should be enough there to get you going and then some.

edit: this was meant to be an answer to another post, please delete or disregard this. Apologies. It seems that I can’t delete my own posts.

> I'm C++ all the way and don't wish to touch swift at all

There is something called MetalCPP that you could try. There is a WWDC video about it.

I've not tried it myself.

GL and ES are all dead everywhere. Vulkan has supplanted them on Android/Windows/Linux. ES 3.2 and GL 4.6 is probably the last version. On macOS, you only have GL4.1 which lacks compute, glClipControl, error callbacks, BC6/7 support, and much more. You can still use GL on M1, but it is emulated atop Metal. So it's time for devs to move on.

The person above is talking nonsense. Opengl is not dead, and metal and vulkan cannot replace GL, because Opengl is still used in the mechanical and medical modeling fields. If you want it to be phased out, at least replace all these supporting facilities with vulkan and let me know. Additionally, if people on the first floor plan to use Opengl, you must abandon the Apple market and leave the Mac, iOS, and iPad, which no longer plan to support Opengl. And in Android, Windows, Linux, and even Nintendo, there is no stop to OpenGL, and you can develop in these places. Don't believe any advice about learning Vulkan, as it is 20 times more difficult than Opengl, with almost no individual developers proficient in mastering it, and even games produced by large companies often experience frequent lag and crashes. Because Vulkan will completely drain hardware performance, while Opengl prevents you from engaging in such extreme behavior. A very young and immature programmer who comes into contact with such a difficult API is a reckless behavior that is difficult to describe in words. I do not recommend any newcomers to graphics programs to come into contact with Vulkan, even if this API has a very good reputation. Therefore, learning Opengl and DX11 is where you belong. If you are just an individual developer, don't come into contact with DX12 and VK. They are very bad, and without a certain level of technical proficiency, you will crash. For so many years, they have not been widely used in games and applications, and you can understand where their problems lie.

Better make sure you have a Mac with apple silicon, Intel Metal hasn't been updated at all in Ventura. OpenGL has been deprecated since Mavericks and is stuck on a broken 4.1 in newer OS releases and doesn't even work, its completely broken due to apple, and its apple's own implementation which is broken, OpenGL is dead on Mac unless you just want to learn it for the sake of learning it now. You essentially can't install a newer openGL in MacOS anymore. OpenGL is still newer and updatable on windows, so if you have an intel Mac you should start on a newer OpenGL, essentially installable on the bootcamp side, but again not really feasible with all the other recent APIs out there. Metal2 is also being deprecated on intel machines older than 2018, and even the 2018 Macs only have symlink updates to be able to dev for metal3. At least that is what I've found. The whole thing is ridiculous really. I'm sure you can start on a metal2 machine and work your way up as needed. You can also start with DX12 and then learn metal while using the new porting toolkit to see what changes are needed while learning Metal.

With a little bit of imagination you can predict where apple is going with its 'need for power' behind their features. And now with vision's features you should expect to see that concept come to the Mac. I do not expect MacOS as we know it to be around much longer at the rate apple is going with pushing UI and processing power needed for it. I doubt it will even be called MacOS anymore once the keyboard, mouse, and UI are deprecated, which was supposed to be with the iMac Pro, but since it was and intel machine... I believe they are holding off doing anything drastic to the Mac until they see what users do with vision, but mark my words, it's going to happen. It's predictable.

Android has phased out ES for Vulkan. Nintendo uses Vulkan or lower-level APIs. Windows only has GL 1.1 support, unless you use IHV installs. Linux is emulating DX and Vulkan with Proton. Metal and DX11 are similar in complexity and power, with Metal being a very straightforward way to use tile-based gpus. OpenGL is dead even if there are stragglers. Let me know when there's a GL 4.7 or an ES 3.3 if you think what I'm saying is nonsense.

OpenGL global state and having to pepper code with glGetError() in WebGL/GL is tedious. There have been many OpenGL implementation on consoles, and no one uses them due to the hidden state.

To be clear I agree that OpenGL is old and there are newer options.

Still, if you want your C code to work on iOS/android/mac/windows with little modifications, still OpenGL is the way to go. I actually wrote such code that its used on a iOS app and Android app, and I am using the same code for a level editor that is running on mac and windows(some of our content editors don't have MACs).

A lot of people ignore the fact that if you want to go for a multi platform approach, developing separate graphic pipelines would incur great costs. In my case I would have needed to write the same code 3 times in different APIs(I suppose Metal on iOS and Mac is about the same). Maintaining that separate pipelines would also be challenging incurring more costs.

Still if you are just starting your multi platform approach, I would suggest to have a look at the 3D engines already available, for example Unity or Unreal engine(those 2 have some licensing costs but I think it's worth it). Those engines usually handle the graphics API stuff and you don't have to worry about OpenGL/Metal/Vulkan/Direct API etc. and you don't have to worry about Apple removing OpenGL because they will handle this(to be fair they are probably already using Metal).

There is so much context left out of most answers here except for @rikAo and @constantinfrompluto. The easy answer is that OpenGL is still the way to go for cross platform GPU programming and it is performant enough except for really extreme stuff. Not the things you do initially anyway. If you bonk your head against a performance wall, then it might be time to switch API. If you are a Mac/iOS person and don't care about the world outside of Apple for the time being Metal is also a solid choice. For your own sanity stay away from Vulkan for now.