![]() |
Sample Code Request: Simple bitmap display
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? |
Re: Sample Code Request: Simple bitmap display
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? |
Re: Sample Code Request: Simple bitmap display
I'm new to maemo but maybe this link helps: API Reference
|
Re: Sample Code Request: Simple bitmap display
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. |
Re: Sample Code Request: Simple bitmap display
Have you looked at SDL?
|
Re: Sample Code Request: Simple bitmap display
I forgot about SDL. Is there a very basic SDL example somewhere that compiles on the scratchbox?
|
Re: Sample Code Request: Simple bitmap display
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! |
Re: Sample Code Request: Simple bitmap display
Do do you need to add any additional libraries to the nokia for this?
|
Re: Sample Code Request: Simple bitmap display
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...? |
Re: Sample Code Request: Simple bitmap display
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. |
All times are GMT. The time now is 05:59. |
vBulletin® Version 3.8.8