raylib platforms and graphics - raysan5/raylib GitHub Wiki

raylib relies on OpenGL as its main graphic API. Depending on the platform, raylib uses different versions of OpenGL by default, but it's possible to configure the desired OpenGL API backend on library compilation; just select the appropriate #define when compiling the rlgl module.

All OpenGL API calls are contained in the rlgl module. This module works as a layer to the underlying graphic API. The selected OpenGL version can be configured in this module using #defines at compile time.

Here is a table with the different OpenGL configurations supported by raylib on the different platforms:

NOTE: PLATFORM_DESKTOP fallbacks to PLATFORM_DESKTOP_GLFW by default!

PLATFORM Flag Platform/OS OpenGL version Notes
PLATFORM_MEMORY - OpenGL Software NEW on raylib 6.0. Output to memory buffer
PLATFORM_DESKTOP_GLFW WindowsLinuxmacOS OpenGL 1.1OpenGL 2.1OpenGL 3.3OpenGL 4.3 macOS does not support OpenGL 4.3
PLATFORM_DESKTOP_SDL WindowsLinuxmacOS OpenGL SoftwareOpenGL 1.1OpenGL 2.1OpenGL 3.3OpenGL 4.3 SDL2 and SDL3 supported
PLATFORM_DESKTOP_RGFW WindowsLinuxmacOS OpenGL SoftwareOpenGL 1.1OpenGL 2.1OpenGL 3.3OpenGL 4.3 Added on raylib 5.5
PLATFORM_DESKTOP_WIN32 Windows OpenGL SoftwareOpenGL 1.1OpenGL 2.1OpenGL 3.3OpenGL 4.3 NEW on raylib 6.0. Win32 API implementation.
PLATFORM_ANDROID Android OpenGL ES 2.0OpenGL ES 3.0 Supported from API level 21
PLATFORM_DRM Linux kernel (native) OpenGL ES 2.0OpenGL ES 3.0 Runs graphics natively over kernel, no X11/Wayland windowing system required
PLATFORM_WEB HTML5 (browser) WebGL 1.0 (OpenGL ES 2.0)WebGL 2.0 (OpenGL ES 3.0) Requires libglfw.js wrapper, provided by emsdk
PLATFORM_WEB_RGFW HTML5 (browser) WebGL 1.0 (OpenGL ES 2.0)WebGL 2.0 (OpenGL ES 3.0) Added on raylib 5.5
PLATFORM_WEB_EMSCRIPTEN HTML5 (browser) OpenGL SoftwareWebGL 1.0 (OpenGL ES 2.0)WebGL 2.0 (OpenGL ES 3.0) NEW on raylib 6.0. Supports software renderer on a 2d canvas

Additional graphic backends potentially supported but not much tested:

PLATFORM Flag Platform/OS OpenGL version Notes
PLATFORM_DESKTOP Windows OpenGL ES 2.0 Support through two possible ways: - WGL_EXT_create_context_es2_profile extension - ANGLE project
PLATFORM_DESKTOP Linux OpenGL ES 2.0 Support through: - GLX_EXT_create_context_es2_profile extension
PLATFORM_ANDROID Android OpenGL ES 3.0 Check Android support here.
PLATFORM_WEB HTML5 (browser) WebGL 2.0 (OpenGL ES 3.0) OpenGL ES 3.0 transformed to WebGL 2.0 on compilation (using emscripten SDK).

Please let me know if you require one of those backends to be implemented.

Additionally, I'm planning a new graphics backend: a simple 2D software renderer. I think it could be useful on some embedded platforms... still on design phase.