---
title: "slint::select_backend Function"
---
```cpp
void slint::select_backend(const BackendRequirements &requirements={})
```

Selects one of Slint's built-in [backends with a renderer](https://docs.slint.dev/latest/docs/slint/guide/backends-and-renderers/backends_and_renderers/) that meets *requirements*, and makes it the active backend. This is a programmatic substitute for the `SLINT_BACKEND` environment variable.

Call this before creating any component or window. For example, to render with desktop OpenGL 3.2 or newer:

```cpp
slint::select_backend({ .graphics_api = slint::GraphicsAPI::OpenGL,
                        .min_opengl_version = { { 3, 2 } } });
auto app = App::create();
```

Aborts the program with an error message if the requirements can't be met, or if a backend is already active.