---
name: "SDL_RenderCoordinatesFromWindow"
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_RenderCoordinatesFromWindow"
---

# SDL\_RenderCoordinatesFromWindow(3)

Get a point in render coordinates when given a point in window coordinates.

## NAME

SDL\_RenderCoordinatesFromWindow - Get a point in render coordinates when given a point in window coordinates.

## HEADER FILE

Defined in SDL3/SDL\_render.h

## SYNOPSIS

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

**bool SDL\_RenderCoordinatesFromWindow(SDL\_Renderer \*renderer, float window\_x, float window\_y, float \*x, float \*y);**

## DESCRIPTION

This takes into account several states:

• The window dimensions.

• The logical presentation settings\
   ( **SDL\_SetRenderLogicalPresentation** )

• The scale ( **SDL\_SetRenderScale** )

• The viewport ( **SDL\_SetRenderViewport** )

## FUNCTION PARAMETERS

- *renderer*

  the rendering context.

- *window\_x*

  the x coordinate in window coordinates.

- *window\_y*

  the y coordinate in window coordinates.

- *x*

  a pointer filled with the x coordinate in render coordinates.

- *y*

  a pointer filled with the y coordinate in render coordinates.

## RETURN VALUE

Returns true on success or false on failure; 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\_SetRenderLogicalPresentation**(3)](/SDL_SetRenderLogicalPresentation/3.md), **•**(3), [**SDL\_SetRenderScale**(3)](/SDL_SetRenderScale/3.md)
