Active Topics

 


Reply
Thread Tools
Posts: 958 | Thanked: 483 times | Joined on May 2010
#21
yes, i would like to have my image centered. it does not need to be scaled. the image is already scaled via internal routines in the app.

i have solved this for now by modifying the call to SDL_BlitSurface and specifying the target rectangle to be slightly offset to the lower right.
 

The Following User Says Thank You to droll For This Useful Post:
javispedro's Avatar
Posts: 2,355 | Thanked: 5,249 times | Joined on Jan 2009 @ Barcelona
#22
Originally Posted by droll View Post
how would i create a UI for this in SDL?
You have a few choices :
- If you're targeting Maemo/Meego only, now it's the time time to think if you should make that UI in Qt. A few 2D games have been developed in QML already.
- Professional games usually have their own widget "toolkit" for SDL/plain framebuffer and they change it for every game so that the widgets are themed in the game's style. This is what most complex/3D iPhone games, WebOS games, etc. do.
- You can use one of those SDL-based widget toolkits around (many of them but I have no experience with any).
- You can code a Gtk+ or Qt launcher application, where you can configure the SDL game before launching it. This is what the built-in N900 games and DrNokSnes do (so you can try the result!).
 

The Following User Says Thank You to javispedro For This Useful Post:
Posts: 958 | Thanked: 483 times | Joined on May 2010
#23
problem is with the app i'm working on, some of the settings need to be changed on the fly. ok, i'll come clean. this is for an apple ][ emulator. i need to be able to swap disks on the fly since there are only 2 drives and some games can span 4 disks.

so the DrNokSnes example won't work for me (would have loved it though. an excuse to learn python).

if i build the UI in Qt (which i would also love!!), my issue is trying to figure out how to tie the entire Qt portions of the code into SDL and the emulator. the emulator is originally written to use directX on windows (AppleWin). i picked up the work after Arnim dropped it off many moons ago (i think 1 year ago) when he did a port to N800. he picked it up from a linux based port of the emulator (that was based off the windows version) that was already running using SDL.

based on ArnimS' version, the emulator could only boot up and load a disk on the N900. it emulated the content fine though but no keyboard input, sound was whacked, tasking out didn't work, etc. a lot of things were broken.

i've been progressively fixing these issue and it is now in a very very useable state on the n900. the next major hurdle i'm facing is to build some simple UI around the emulator that allows the user to change settings on the fly. that's where i'm currently stuck at, and i'm leaning now towards the UI libraries that are listed on the SDL home page.

Last edited by droll; 2011-07-08 at 18:20.
 
javispedro's Avatar
Posts: 2,355 | Thanked: 5,249 times | Joined on Jan 2009 @ Barcelona
#24
Originally Posted by droll View Post
so the DrNokSnes example won't work for me (would have loved it though. an excuse to learn python).
You can configure stuff on the fly in DrNokSnes. Try it Behind the scenes, it just saves state, terminates the SDL application, switches to UI app, then respawns SDL application and restores state when finished.

(It is not python btw).
 
Posts: 958 | Thanked: 483 times | Joined on May 2010
#25
hmmmmm that's an interesting idea (saving state)...will give this a thought.
 
Posts: 4 | Thanked: 2 times | Joined on Aug 2010 @ Germany
#26
SDL and GUI is a nightmare IMO for everything else than a game (at least on a desktop). I would not use it again for a software project! You could check out Agar GUI, that's what we sticked to in the end (with all the problems of a non-standard GUI). The dev is responsive, it is fast, portable and themeable. Basically it can substitute SDL (but also works on top of it).
 
Posts: 958 | Thanked: 483 times | Joined on May 2010
#27
yeah, i had a look at it and was thinking of using Agar as a last resort. i am still inclined to work with the DrNokSnes approach.

i tested saving and restoring state on the emulator last night and it works fine. all i need now is a way to communicate between a separate app, say in Qt for all the menu options etc, and the emulator itself so that each knows when to stop and continue when the other is done.

i'm guessing the Qt app will be the entry point to the emulator. it then fires up the emulator once all configuration is done. however, i have yet to figure out how to get the emulator to return control back to the Qt app when the user wants to change some configuration.

i was thinking of sending a kill signal to the emulator (the emulator already has an option to save state when it exits gracefully) from the Qt app and leaving the Qt app running all the while. but i do need to be able to differentiate between a user exiting the emulator and a user wanting to make a change in the config. not impossible as i have a rough idea of how to do this already with exit codes.

Last edited by droll; 2011-07-11 at 01:53.
 
Posts: 958 | Thanked: 483 times | Joined on May 2010
#28
anyone has experience around the audio APIs in SDL? specifically, i'm referring to these http://wiki.libsdl.org/moin.cgi/CategoryAudio. the emulator doesn't use sdl_mixer.

i seem to be getting crackling sounds everytime an audio clip is played by the emulator.

it plays fine but at the end there is a slight crack in the audio output. as a result, some games have music that lags (i'm guessing because the game plays music as separate distinct "pulses" vs a continuous stream).

any ideas?

Last edited by droll; 2011-07-11 at 01:52.
 
Posts: 958 | Thanked: 483 times | Joined on May 2010
#29
no one? increasing the buffer size obviously solves this but introduces lag (no surprises, FIFO buffer).
 
Posts: 958 | Thanked: 483 times | Joined on May 2010
#30
it seems like SDL is buggy on the N900. i have audio buffers that have zero-ed values being submitted to SDL via the audio callback function and i still hear crackling sounds. NOOOOOOOOOOOOOOOOOOOOOO!!!


http://lists.mandriva.com/bugs/2010-04/msg02238.php
http://maemo.org/packages/view/libsdl1.2/
http://bugzilla.libsdl.org/show_bug.cgi?id=698

sigh.....we have 1.2.13 on the n900.
the bug was fixed in 1.2.14 of SDL.

damnit!

Last edited by droll; 2011-07-12 at 18:07.
 
Reply


 
Forum Jump


All times are GMT. The time now is 03:21.