hoang.HEDSPi
hoang.HEDSPi

Reputation: 21

How to convert SDL_renderer to SDL_window?

I'm starting with SDL2 and and having some trouble trying to conver SDL_renderer to SDL_window. How I can convert SDL_rnderer to SDL_window exactly?

Upvotes: 0

Views: 217

Answers (2)

kdyz
kdyz

Reputation: 1550

It's not possible. A window is, well, a window. While a renderer is responsible for rendering/generating the image. The "insides" of a window usually consists of a renderer.

In this way, a window uses a renderer which should explain why it's not possible to convert a renderer to a window.

Upvotes: 0

skypjack
skypjack

Reputation: 50540

You cannot, they are different structures.

Anyway, you can create a SDL_Renderer for a given SDL_Window by means either of the SDL_CreateRenderer method or the SDL_CreateWindowAndRenderer method.

Upvotes: 2

Related Questions