1
\$\begingroup\$

I am developing a 2d game which has a lateral panel and a main panel with the scenario. I want to scale the main scenario to apply a zoom (only the main panel portion of the screen).

I think if I use SDL_SetRenderTarget I will be able to change textures and then zoom it, in runtime. I have to use only SDL2 library or some extension. I can't use openGL.

How can I accomplish this?

\$\endgroup\$
1
\$\begingroup\$

What you should do is render to a texture (via render targets) and then draw the texture to the screen. Then take a portion of the texture and render it with in a rectangle somewhere on screen. (SDL_RenderCopy lets you only draw a portion of the texture)

| improve this answer | |
\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.