maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Maemo 5 / Fremantle (https://talk.maemo.org/forumdisplay.php?f=40)
-   -   SDL on N900 / Maemo (https://talk.maemo.org/showthread.php?t=74299)

droll 2011-06-25 01:29

Re: SDL on N900 / Maemo
 
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.

droll 2011-07-08 00:07

Re: SDL on N900 / Maemo
 
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.

droll 2011-07-08 00:43

Re: SDL on N900 / Maemo
 
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?

demolition 2011-07-08 00:58

Re: SDL on N900 / Maemo
 
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!

droll 2011-07-08 01:22

Re: SDL on N900 / Maemo
 
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.

demolition 2011-07-08 02:36

Re: SDL on N900 / Maemo
 
Quote:

Originally Posted by droll (Post 1046798)
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.

droll 2011-07-08 09:24

Re: SDL on N900 / Maemo
 
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.

droll 2011-07-08 16:26

Re: SDL on N900 / Maemo
 
i guess it won't work. i think the best way is to use any of the available UI libraries for SDL.

javispedro 2011-07-08 17:13

Re: SDL on N900 / Maemo
 
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.

droll 2011-07-08 17:28

Re: SDL on N900 / Maemo
 
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?


All times are GMT. The time now is 10:29.

vBulletin® Version 3.8.8