---
name: "SDL_CreateSoftwareRenderer"
section: "3"
platform: "linux"
package: "libsdl3-doc"
version: "3.2.10+ds-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/SDL_CreateSoftwareRenderer"
---

# SDL\_CreateSoftwareRenderer(3)

Create a 2D software rendering context for a surface.

## NAME

SDL\_CreateSoftwareRenderer - Create a 2D software rendering context for a surface.

## HEADER FILE

Defined in SDL3/SDL\_render.h

## SYNOPSIS

```
#include "SDL3/SDL.h"
```

**SDL\_Renderer \* SDL\_CreateSoftwareRenderer(SDL\_Surface \*surface);**

## DESCRIPTION

Two other API which can be used to create  **SDL\_Renderer** :

**SDL\_CreateRenderer** () and

**SDL\_CreateWindowAndRenderer** (). These can \_also\_ create a software renderer, but they are intended to be used with an

**SDL\_Window**\
  as the final destination and not an

**SDL\_Surface** .

## FUNCTION PARAMETERS

- *surface*

  the  **SDL\_Surface**\
    structure representing the surface where rendering is done.

## RETURN VALUE

( **SDL\_Renderer**\
  \*) Returns a valid rendering context or NULL if there was an error; call  **SDL\_GetError** () for more information.

## THREAD SAFETY

This function should only be called on the main thread.

## AVAILABILITY

This function is available since SDL 3.2.0.

## SEE ALSO

**•**(3), [**SDL\_DestroyRenderer**(3)](/SDL_DestroyRenderer/3.md)
