Reply
Thread Tools
Posts: 76 | Thanked: 2 times | Joined on Dec 2005
#1
Now that I have the scratchbox working, I was wondering if anyone could point me to some specific sample code that would do the following:

1. Go to full screen
2. Display a bitmap (ARGB or RGBA format)
3. Receive mouse (or rather, stylus) events
4. Quit on hardware back button press (ESC)

Something like a really barebones paint app that works at a bitmap level, rather than using GTK drawing calls.

Anything like that exist?
 
Posts: 76 | Thanked: 2 times | Joined on Dec 2005
#2
I've got that sample app that comes with the Maemo VMWare Appliance, that opens a window with a full screen button.

It can't be that much harder. I'm familiar with GUI programming, I just don't know anything about GTK's API.

Shove in the right direction anyone?
 
Posts: 178 | Thanked: 40 times | Joined on Aug 2007 @ UK
#3
I'm new to maemo but maybe this link helps: API Reference
 
Posts: 76 | Thanked: 2 times | Joined on Dec 2005
#4
It does help, actually!

So, I need to wrap my raw bitmap with a GdkPixbuf it seems. I think I can handle that.

Still not sure how to get it from there onto the screen though.
 
maba's Avatar
Posts: 38 | Thanked: 10 times | Joined on Mar 2006
#5
Have you looked at SDL?
 
Posts: 76 | Thanked: 2 times | Joined on Dec 2005
#6
I forgot about SDL. Is there a very basic SDL example somewhere that compiles on the scratchbox?
 
Posts: 76 | Thanked: 2 times | Joined on Dec 2005
#7
I found some simple SDL examples that compile for Maemo here:

https://garage.maemo.org/projects/n770demos/

For future reference (mine, or whoever), this is how I built the n770-fire demo under the scratchbox:

gcc -o n770-fire n770-fire.c `pkg-config --cflags gtk+-2.0 hildon-libs` `sdl-config --cflags` -ansi -Wall `pkg-config --libs gtk+-2.0 hildon-libs` `sdl-config --libs`

After using sb-menu to switch to the ARM environment, compiling, I was able to transfer and run the executable from Xterm on the N800!
 
tabletrat's Avatar
Posts: 481 | Thanked: 65 times | Joined on Aug 2007 @ Westcountry, UK
#8
Do do you need to add any additional libraries to the nokia for this?
 

The Following User Says Thank You to tabletrat For This Useful Post:
Posts: 76 | Thanked: 2 times | Joined on Dec 2005
#9
SDL was already installed on my N800. Whether that's by default or if it's a dependency for something else I installed, I'm not sure.

Although libSDL was preinstalled in the Maemo VMWare Appliance, so I'm inclined to think it's all included...?
 
Posts: 76 | Thanked: 2 times | Joined on Dec 2005
#10
Thanks to maba for the SDL suggestion. Since it's cross-platform, I can do most of my development in my native Mac OS X environment, and then just fire up the Maemo VMWare appliance if I want to actually cross-compile something to try on the device.

All I've done so far is an incredibly basic full-screen "paint white blobs with the stylus" program, but it's really cool to see it run on both my Mac and the tablet.
 
Reply


 
Forum Jump


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