<p>The choice of which API to use is less important then the concepts and methods that the API's are designed to implement. Once you understand the basic graphics concepts and how to implement them using any API, then it is fairly straight forward to implement the same thing in a new API.</p>
<p>Since you are interested in cross-platform you may want to stay away from DirectX as it is more for Xbox and the PC. OpenDX, and other &quot;layers&quot; are available for Linux but I wouldn't recommend using them by someone just getting started as they can have undocumented API limitations and bugs.</p>
<p>Choosing which API to use is fairly subjective. There is good documentation and support for all the API's and you may want to write a few simple test programs using each of the interfaces you are considering to see which one is a good fit for you.</p>
<p>How strong your programming skills are, and what programming language you are planning to use can also be a deciding factor. A strong C++ programmer will likely pick up Vulkan more easily then someone new to the language, while OpenGL can be easier for someone new to programming in general. OpenGL and its interface is also available in more languages, like python, and WebGL. Again, I recommend trying out some simple programs to see which is a good fit.</p>
<p>There is nothing wrong with writing a game using one of the scripting languages because it allows you to focus on the concepts more then the code. And it can abstract some of the more difficult concepts away. Then when you start hitting the limitations of the format, move on to a more expressive language like Rust, C or C++.</p>

CC BY-SA 4.0
2024-03-22T15:52:29.770Z
Thank you for the detailed explanation. This clears things up a lot for me and also aligns with my findings from my online research. I decided I would go with OpenGL and C++. I am good at C++ but I'd like to get things up and running as soon as possible. And so far OpenGL seems to be working well with WIndows and Linux for basic graphics.
Prav
CC BY-SA 4.0
2024-03-21T18:58:47.497Z
2024-03-21T18:58:47.497Z
pmw1234
<p>Good people of the graphics SO community, I am new to Graphics programming or GPU programming in general but I have been a game dev enthusiast for over 4-5 years. I started learning about Graphics finally.</p>
<p>I decided to start working on a very very basic 3D first-person game that can run on my Steam Deck, a Linux computer (most commonly used basic distros), a Windows computer (especially 8, 10, and 11), and MacOS (not super bullish on this).</p>
<p>So I learned about a bunch of APIs like OpenGL, Vulkan, and DirectX (I know some of them are technically not APIs but specifications, or not, please correct me on this) and I came across some forums that convey the support of these APIs in different OS types, but the answers are biased towards the specificity of one or two particular OSes mentioned in the questions.</p>
<p>I'd really appreciate it if someone gave advice on which API/Specification(s) to learn to work on a basic game like this one - <a href="https://jblaha.art/sketchbook/latest" rel="nofollow noreferrer">https://jblaha.art/sketchbook/latest</a> and that has support on all the devices/OSes mentioned above.</p>
<p>Thank you so much in advance.</p>
<p>(p.s. I already started learning OpenGL from <a href="https://learnopengl.com/" rel="nofollow noreferrer">https://learnopengl.com/</a> and I'd be glad to use this for my game. But I would learn a different one if I'm advised to do so.)</p>

CC BY-SA 4.0
2024-03-20T07:33:35.280Z
Welcome to Computer Graphics Stack Exchange! You are right, there are different "API/Layouts" that work on different operating systems. If you focus only on Windows and Linux, it's very simple: you can use OpenGL or Vulcan. MacOS brings the difficulties... They have their own graphics library (Metal) and they have dropped support for OpenGL, see https://stackoverflow.com/questions/65802625/develop-using-opengl-4-x-on-osx-big-sur
Thomas
CC BY-SA 4.0
2024-03-20T07:35:51.840Z
However, you can do a double implementation, which means that you create a superclass from which you can derive two classes (e.g. OpenGL and Metal). The API calls should then only be within methods of this class
Thomas
CC BY-SA 4.0
2024-03-20T10:06:21.573Z
There are also game engines instead of graphic libraries (APIs). Some of these game engines are cross platform. In addition, many techniques such as shadows, collision detection or physics are already implemented...
Thomas
CC BY-SA 4.0
2024-03-20T21:40:19.647Z
Thank you for the detailed response @Thomas, I appreciate it. The reason I'm not using a Game Engine is because I want to learn how to make a game engine with minimal features which I want to build as needed for my game. The Superclass method you described is a great idea. I will abstract away the API layers in their own classes so I can implement different methods for different devices
Prav
CC BY-SA 4.0
2024-03-21T07:24:52.450Z
Abstracting the API layers is not as easy as you might think... Before you start, you need to understand how the graphics APIs you're using work... There is a lot to consider
Thomas
CC BY-SA 4.0
2024-03-21T14:50:43.767Z
I did more deep research yesterday and you are absolutely right. I decided to move forward with OpenGL 3.3 since I mostly want it to work on Linux and Windows. Since this is just a learning project for me, I will experiment and keep testing on Windows and Linux and Steam Deck as I go :)
Prav
<opengl><3d><glsl><vulkan><directx>
Preferred GPU API to use for Steam Deck, Windows, Linux and MacOS support
Prav
# Preferred GPU API to use for Steam Deck, Windows, Linux and MacOS support

(Asked by: username_0 on 2024-03-18)

Good people of the graphics SO community, I am new to Graphics programming or GPU programming in general but I have been a game dev enthusiast for over 4-5 years. I started learning about Graphics finally.

I decided to start working on a very very basic 3D first-person game that can run on my Steam Deck, a Linux computer (most commonly used basic distros), a Windows computer (especially 8, 10, and 11), and MacOS (not super bullish on this).

So I learned about a bunch of APIs like OpenGL, Vulkan, and DirectX (I know some of them are technically not APIs but specifications, or not, please correct me on this) and I came across some forums that convey the support of these APIs in different OS types, but the answers are biased towards the specificity of one or two particular OSes mentioned in the questions.

I'd really appreciate it if someone gave advice on which API/Specification(s) to learn to work on a basic game like this one - <https://jblaha.art/sketchbook/latest> and that has support on all the devices/OSes mentioned above.

Thank you so much in advance.

(p.s. I already started learning OpenGL from <https://learnopengl.com/> and I'd be glad to use this for my game. But I would learn a different one if I'm advised to do so.)

**Tags:** opengl, 3d, glsl, vulkan, directx

> **Comments:**
> **username_1**: Welcome to Computer Graphics Stack Exchange! You are right, there are different "API/Layouts" that work on different operating systems. If you focus only on Windows and Linux, it's very simple: you can use OpenGL or Vulcan. MacOS brings the difficulties... They have their own graphics library (Metal) and they have dropped support for OpenGL, see https://stackoverflow.com/questions/65802625/develop-using-opengl-4-x-on-osx-big-sur  
> **username_1**: However, you can do a double implementation, which means that you create a superclass from which you can derive two classes (e.g. OpenGL and Metal). The API calls should then only be within methods of this class  
> **username_1**: There are also game engines instead of graphic libraries (APIs). Some of these game engines are cross platform. In addition, many techniques such as shadows, collision detection or physics are already implemented...  
> **username_0**: Thank you for the detailed response @username_1, I appreciate it. The reason I'm not using a Game Engine is because I want to learn how to make a game engine with minimal features which I want to build as needed for my game. The Superclass method you described is a great idea. I will abstract away the API layers in their own classes so I can implement different methods for different devices  
> **username_1**: Abstracting the API layers is not as easy as you might think... Before you start, you need to understand how the graphics APIs you're using work... There is a lot to consider  
> **username_0**: I did more deep research yesterday and you are absolutely right. I decided to move forward with OpenGL 3.3 since I mostly want it to work on Linux and Windows. Since this is just a learning project for me, I will experiment and keep testing on Windows and Linux and Steam Deck as I go :)  

---

## 1 answers

### Answer by username_2 on 2024-03-21. Score: 2

The choice of which API to use is less important then the concepts and methods that the API's are designed to implement. Once you understand the basic graphics concepts and how to implement them using any API, then it is fairly straight forward to implement the same thing in a new API.

Since you are interested in cross-platform you may want to stay away from DirectX as it is more for Xbox and the PC. OpenDX, and other "layers" are available for Linux but I wouldn't recommend using them by someone just getting started as they can have undocumented API limitations and bugs.

Choosing which API to use is fairly subjective. There is good documentation and support for all the API's and you may want to write a few simple test programs using each of the interfaces you are considering to see which one is a good fit for you.

How strong your programming skills are, and what programming language you are planning to use can also be a deciding factor. A strong C++ programmer will likely pick up Vulkan more easily then someone new to the language, while OpenGL can be easier for someone new to programming in general. OpenGL and its interface is also available in more languages, like python, and WebGL. Again, I recommend trying out some simple programs to see which is a good fit.

There is nothing wrong with writing a game using one of the scripting languages because it allows you to focus on the concepts more then the code. And it can abstract some of the more difficult concepts away. Then when you start hitting the limitations of the format, move on to a more expressive language like Rust, C or C++.

> **Comments:**
> **username_0**: Thank you for the detailed explanation. This clears things up a lot for me and also aligns with my findings from my online research. I decided I would go with OpenGL and C++. I am good at C++ but I'd like to get things up and running as soon as possible. And so far OpenGL seems to be working well with WIndows and Linux for basic graphics.  

---

