A Brief Introduction to Graphics Apis

Okay so, what exactly is a “graphics api” anyway?

A graphics API (Application Programming Interface) is essentially a software interface that allows your application (think of something like a game or a 3D editor) to communicate with the GPU (Graphics Processing Unit)— the chip responsible for rendering images on screen.

Modern graphics programming relies on graphics APIs — these APIs essentially act as the middle layer between your application and the hardware, handling tasks like rendering images, running compute workloads, and managing resources efficiently.

There are several graphics APIs available today, each with different levels of abstraction and performance:

  • OpenGL: Easy to use, cross-platform, but now outdated and less efficient.
  • Direct3D: Microsoft’s API for Windows and Xbox, part of DirectX.
  • Vulkan: – A modern, low-level, cross-platform API designed for high performance.
  • Metal: – Apple’s low-level API designed specifically for macOS, iOS, and other Apple platforms.

Metal, the star of our show, was introduced as a modern replacement for OpenGL, offering much finer control over the GPU, significantly better performance, predictability and better battery life.

What is Metal?

Unlike OpenGL, Metal is a graphics API that is explicit and stateless, you therefore have to define:

  • What the GPU should do
  • When it should do it
  • With which resources (buffers, textures, shaders, etc..)

Metal apps typically follow this high-level pattern:

flowchart LR
    A[Application] --> B{CPU}
    B --> C[Setup Resources]
    C --> D[Build Command Buffers]
    D[Build Command Buffers] --> E[Command Queue]
    E[Command Queue] --> F{GPU}
    F{GPU} --> G[Screen]

As you can see in the flowchart above, we essentially tell the CPU to setup the resources (like vertex data, textures, uv coordinates etc..), we then take all of this data and package it into something called Command Buffers (which we’ll get more in detail into in the next tutorials) - once we have these command buffers, we send them to a so called Command Queue, to then dispatch them and finally display things on the screen.


Copyright © 2025 Gabriele Vierti. Distributed by an MIT license.