Reply
Thread Tools
Posts: 958 | Thanked: 483 times | Joined on May 2010
#11
i like SDL too because of its simplicity and straight forwardness. feels like old-school API. there is less abstraction. it feels closer to the hardware. but that also means i have to do a bit more work on my own for some scenarios - which is fine by me.
 
Posts: 958 | Thanked: 483 times | Joined on May 2010
#12
folks - is there a way i can hildonize the SDL window? i'm trying to add some menu buttons and options to the app but can't find any examples for doing this.
 
Posts: 958 | Thanked: 483 times | Joined on May 2010
#13
also, i read in the wiki that a non-full screened SDL window will always be aligned to the top left corner of the screen. other than offsetting all my pixel drawing code, is there any other way to still have coordinate (0,0) offset slightly to the lower right?
 
Posts: 560 | Thanked: 422 times | Joined on Mar 2011
#14
Don't quite know what you need to do but you could have a look at using zenity. I've tweaked a few scripts but not built one from scratch. It looks similar to win32 dialog-script before visual studio turns them into GUI dialogs for you. The buttons can then call scripts or in your case possibly programme-functions.

Are there any GUI classes in SDL that could be used to make your menus etc? If so, just be careful with font-size and word-length - at least you know which device it's aimed at - not like pc software!
 
Posts: 958 | Thanked: 483 times | Joined on May 2010
#15
the second part can be found here http://wiki.maemo.org/Game_development

if you look under the section about "SDL specific notes", look at the second bullet point. that's the issue i'm facing now. in non full screen mode, the window is aligned to the top left corner of the screen and my window is smaller than the entire screen size. so i'm getting a black border on the lower right section of the screen. ugly.

as for menus, i'll take a peek at Zenity. i just want to implement some menus in my SDL application that allows the user to configure some settings.

thanks.
 
Posts: 560 | Thanked: 422 times | Joined on Mar 2011
#16
Originally Posted by droll View Post
as for menus, i'll take a peek at Zenity. i just want to implement some menus in my SDL application that allows the user to configure some settings.

thanks.
Have a search on TMO for the get_iplayer GUI it uses sed and zenity to send commands to software written in perl. Depending on how you can get it to call/change functionality of your programme, it'd probably be easier to use than doing it in SDL, especially if there are no UI classes. Alternatively, if you can separate the UI from the core functionality you cold use Qt. But, if you end up having to include Qt across the whole programme it might slow it down.
 
Posts: 958 | Thanked: 483 times | Joined on May 2010
#17
hmmmmmm......neither seems like an elegant solution to me. both are painful. i'll still take a look. i would also keep trying to hack the SDL window to see if i can extend it. perhaps a search for SDL and GTK+ might give some clues......thanks.
 
Posts: 958 | Thanked: 483 times | Joined on May 2010
#18
i guess it won't work. i think the best way is to use any of the available UI libraries for SDL.
 
javispedro's Avatar
Posts: 2,355 | Thanked: 5,249 times | Joined on Jan 2009 @ Barcelona
#19
Can you elaborate on what you want to do?

- If you want to show the "window has menu" icon on the titlebar, that is mostly easy to do. But what are you going to do when the user clicks on it? Render an in-game menu? -- that would be easy. Open a new popup window? hard -- SDL 1.2 does not support multiple windows.
- You don't like top-right, ok. So do you want the image centered? Scaled?

Either way, I suggest you avoid windowed mode like the plague (so also, you should not do the menu thing). There's a large performance hit so anything other than simple 2D apps get slow.

I also suggest you do not create a surface that is smaller than the screen, because that is not portable -- maemo adds black borders, but webos rescales.

Last edited by javispedro; 2011-07-08 at 17:29.
 

The Following User Says Thank You to javispedro For This Useful Post:
Posts: 958 | Thanked: 483 times | Joined on May 2010
#20
the app is a simple 2d app. so far it doesn't consume more than 50% CPU (averages about 20-30% when it is running full speed). so speed is still ok.

i don't want to set an icon on the title bar. that's not important to me

all i want is a bunch of user interface elements that i can use to change settings in my app. for example, i would like to change the path where my app saves data. how would i create a UI for this in SDL?
 
Reply


 
Forum Jump


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