APIs and what they mean in game development?

Ok so I've been getting into some basic coding, it started with website design type stuff (html, css, java and php), but I'm also starting to learn C++. Now, when I say basic I mean I'm just now getting into coding and know very little, but I would like to use my knowledge of coding once I know enough of it to program games. My question is, I hear a lot about openGL and DirectX, but after doing some reading on them I understand that they aren't programs. What exactly is openGL and DirectX? and if I was to want to make a game, where do they come in to the development?

 

 

They are a layer between you and your GPU. If for example, you wanted to draw a circle, you would need to tell Direct3D or OpenGL to do it, and they would interface with GPU driver to draw it. You can't actually make direct calls to GPU because you need to go through a driver because it's a completely different architecture than x86. Mantle is a lot simpler as while it's still a layer, it allows to do a lot more fine control, and DirectX and OpenGL do a lot of bloated checking and extra instructions. Mantle CAN be a lot faster because you can control every aspect to a fine detail and you will know it's only doing exactly what you sent. Correct me if I'm wrong.

That makes sense, so, how would I choose which one to use when making a game?

OpenGL. It is simpler. It is cleaner. It is cross platform. It is THE industry standard. Not much more I can say. But you are a long ways from worrying about this. Make a good couple dozen command prompt programs, learn C++ well and using OpenGL won't be as hard.