Using libsdl on a 240x320 framebuffer

playing around with a lcd whose resolution is 240x320 … basically like a
320x240 but rotated … what’s the best way to approach this ? currently we
just update the checkres[] and vesa_timings[] arrays by duplicating the
existing 320x240 elements but just reversing the x and y … but i imagine
there is probably a better way to do this :slight_smile:
-mike

You could make things be a % of screen size instead of exact pixels (or calc
the exact pixels when the game fires up).

Kinda like how html handles diff resolutions and OpenGL too (:> ----- Original Message -----

From: sdl-bounces+atrix2=cox.net@libsdl.org
[mailto:sdl-bounces+atrix2=cox.net at libsdl.org] On Behalf Of Mike Frysinger
Sent: Tuesday, May 09, 2006 5:32 PM
To: sdl at libsdl.org
Subject: [SDL] using libsdl on a 240x320 framebuffer

playing around with a lcd whose resolution is 240x320 … basically like a
320x240 but rotated … what’s the best way to approach this ? currently we

just update the checkres[] and vesa_timings[] arrays by duplicating the
existing 320x240 elements but just reversing the x and y … but i imagine
there is probably a better way to do this :slight_smile:
-mike


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

playing around with a lcd whose resolution is 240x320 … basically like a
320x240 but rotated … what’s the best way to approach this ? currently we
just update the checkres[] and vesa_timings[] arrays by duplicating the
existing 320x240 elements but just reversing the x and y … but i imagine
there is probably a better way to do this :slight_smile:

That seems reasonable to me. :slight_smile:
SDL in subversion also reads fb.modes, so if you have a mode defined there
it should work as well:
http://www.libsdl.org/svn.php

See ya,
-Sam Lantinga, Senior Software Engineer, Blizzard Entertainment

scaling isnt the issue here, it’s a matter of rotation …
-mikeOn Tuesday 09 May 2006 20:34, Alan Wolfe wrote:

You could make things be a % of screen size instead of exact pixels (or
calc the exact pixels when the game fires up).

hmm, idea … instead of special casing this rotation, what if we walk the
arrays twice ? the first time we do it normally while the second time we do
it but with the x and y (and such relevant fields) swapped ?
-mikeOn Tuesday 09 May 2006 21:26, Sam Lantinga wrote:

playing around with a lcd whose resolution is 240x320 … basically like
a 320x240 but rotated … what’s the best way to approach this ?
currently we just update the checkres[] and vesa_timings[] arrays by
duplicating the existing 320x240 elements but just reversing the x and y
… but i imagine there is probably a better way to do this :slight_smile:

That seems reasonable to me. :slight_smile:

hmm, idea … instead of special casing this rotation, what if we walk the
arrays twice ? the first time we do it normally while the second time we do
it but with the x and y (and such relevant fields) swapped ?

Sure, want to write a quick patch and try it out?

-Sam Lantinga, Senior Software Engineer, Blizzard Entertainment

yep … i’ll test it out tomorrow and see if i cant get something worth
submitting :slight_smile:
-mikeOn Wednesday 10 May 2006 00:14, Sam Lantinga wrote:

hmm, idea … instead of special casing this rotation, what if we walk
the arrays twice ? the first time we do it normally while the second
time we do it but with the x and y (and such relevant fields) swapped ?

Sure, want to write a quick patch and try it out?