🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

scaling with SDL

Started by
3 comments, last by ManaStone 19 years, 10 months ago
Is there a way I can scale images in SDL?
-----------------------------Download my real time 3D RPG.
Advertisement
Check out the SDL_gfx library. It has the ability to rotate and zoom images, though I don't know how well it performs. Or if you are more ambitious, you can easily bind OpenGL code to your SDL program. That's what I decided to do when I was posed with the same problem you have.

Hero of Allacrost - A free, open-source 2D RPG in development.
Latest release June, 2015 - GameDev annoucement

Thx, while we are on the subject is there any way we can make the window non-movable or find out what the current resolution is?
-----------------------------Download my real time 3D RPG.
Quote: Original post by ManaStone
Thx, while we are on the subject is there any way we can make the window non-movable or find out what the current resolution is?


Hmm, I'm not sure abou making the window non-movable. I know there's a way to do it but I think it might be platform dependant code (in other words, not in SDL).


Do you mean you want to know the user's resolution when the game starts? I'm not sure how to do that one either, but you can find out the supported resolutions that your user can run by making a call to SDL_ListModes(). They way I have things setup in my app right now is that when the game is first installed, it chooses a default supported resolution for the user. Then in the options menu we give the user the ability to change to a different res as long as its supported. The game stores this resolution in a configuration file and after the game is exited and the user executes it again, it will automatically use the most recently selected resolution.

In this way you can always "know" what resolution your user is doing, as long as you set it up for them initially and keep track whenever the user changes it. I hope that helps out.

Hero of Allacrost - A free, open-source 2D RPG in development.
Latest release June, 2015 - GameDev annoucement

Ok, the reason I'm asking is because I want to be able to make a window that is maximized when opened. The only way I know to do that is to get the current resolution.
-----------------------------Download my real time 3D RPG.

This topic is closed to new replies.

Advertisement