SDL: Best way to stretch to fullscreen?


doragasu

Member
Joined
Jun 2, 2008
Messages
325
Hi guys.

I'm porting to OpenPandora L'Abbaye des Morts.

I got everything working, but the game ran a bit slow even at 800 MHz. The game internals are 320x240, but to display the window fullscreen, it creates a 640x480 window and before drawing the screen, it uses zoomSurface(pWindow, 2, 2, 0) to convert it to 640x480.

I tried creating a 320x240 window and removing the zoomSurface() function, and the game runs fullspeed, but when I switch fullscreen using SDL_WM_ToggleFullScreen(pWindow), the 320x240 screen isn't stretched to 640x480, :( .

¿How can I stretch the graphics fullscreen without a big performance penalty?
 
Last edited by a moderator:
Hey cool, I like that one. Its always annoying for me to use arrow keys. I'd much prefer controller support but since its coming to OpenPandora, I'm very much looking forward to play it using a d-pad and X/B or whatever button (assuming you map it that way)  ; )

...and sry can't help you regarding the resolution matter
 
Notaz's SDL saved me a ton of time, other wise I would of had to modify scalers and I haven't succesfully done that yet even after hours of work.
 
Yeah, agreed. I had the exact same problem with cannonball, and using Notaz I had the speed boost I needed.

In your launch script, just add :

Code:
export SDL_VIDEODRIVER="omapdss"
export SDL_OMAP_VSYNCH="0"
export SDL_OMAP_LAYER_SIZE="640x480"
 
Thanks a bunch, it's working perfect, stretched to 640x480 and fullspeed at 600 MHz. There's only one thing I'm not happy with. It's the image is bilinear filtered. For this game I'd prefer it to be point sampled. Is there a way to turn off bilinear filtering when using notaz SDL?

Hey cool, I like that one. Its always annoying for me to use arrow keys. I'd much prefer controller support but since its coming to OpenPandora, I'm very much looking forward to play it using a d-pad and X/B or whatever button (assuming you map it that way)  ; )
I have already mapped Jump to the X button. I left crouch pressing down, I like it that way.
 
you need to change the filter to use point sampling

http://pandorawiki.org/Kernel_interface#using_predefined_filters


take a look there. i'm not sure how up to date that info is but worth a try :)
Again, thanks for help. It looks like that method needs root privileges to run (it uses sudo). I'd prefer not forcing the user to input his/her password each time the game is ran. Is there other method?

BTW, I have already uploaded the PND using the bilinear filter. I'll update it if I find a good way to use point sampling instead of bilinear filtering. You can find it here.
 
Last edited by a moderator:
the suggested method is also used by notaz inside gpsp. so thats always an indicator for me that it's the way to go.


look here: http://notaz.gp2x.de/cgi-bin/gitweb.cgi?p=gpsp.git;a=blob_plain;f=pandora/pnd.c;hb=HEAD


function set_filter


you also dont need to ask for password.
I have manually tested it, and I was surprised sudo doesn't ask for a password (I'm intrigued, can anybody explain me why?). So I'll update the app with a filter selection option :) . Thanks!
 
Because sudo is configured not to ask for password when running certain things.

See file /etc/sudoers.d/50_openpandora
 
Didn't know sudo is this flexible. I have been using GNU/Linux for years, and I still have to learn a whole lot of things :)

I have updated the PND. Now the program defaults to point sampling, and filter can be switched between "none" and "default" by pressing the "F" key.
 
Back
Top