Device Independent Resolution
Category: SDL Adventure Game
Initially, I set a fixed window size of 800x600, but this caused issues as the iPhone screen is smaller and the iPad screen is larger. On the iPhone, most of the game screen was not visible, making it impossible to play:
On the iPad, the game looked broken, occupying only a small portion of the screen:
I resolved this issue by calling SDL_RenderSetLogicalSize
in the initialization function:
1
SDL_RenderSetLogicalSize(renderer, WINDOW_WIDTH, WINDOW_HEIGHT);
Here’s the result on the iPhone after implementing the solution:
And on the iPad after the fix: