PDK FAQ
From WebOS101
General
Q. Can I use libraries not provided by Palm in my PDK application?
A. Yes! Build and statically link the libraries into your executable.
Q. How can I build my app so that it works on both the Pixi and the Pre?
A. Use the Pixi's architecture settings when building your app. The Pre is capable of executing code targeted for the Pixi.
Q. My SDL app doesn't work on the Pixi (webOS 1.4.5). How can I make it work?
A. See this article: http://metaviewsoft.de/wordpress/?p=459
Q. How do I take a screenshot of my PDK application?
A. Two ways:
cat /dev/fb1 > /media/internal/fbfrom the device and load as raw image data into Gimp (and others?)
Or, add the following to a key event in your app:
SDL_SaveBMP(MainSurface,"/media/internal/screenshot.bmp");
See: https://developer.palm.com/distribution/viewtopic.php?f=70&t=6649
Q. I keep getting linker warnings when linking my PDK app (e.g. warning: libssl.so.0.9.8, needed by C:\Program Files\Palm\PDK\device\lib/libpdl.so, not found (try using -rpath or -rpath-link)). Can I make these go away?
A. Yes, you can! Check out this article: Workaround for bogus library not found linker warnings
OpenGL ES
Q. I've never used OpenGL ES before, can I use standard OpenGL?
A. It is currently not possible to do so. OpenGL requires certain features to be present on the graphics card that are not frequently found on mobile devices. OpenGL ES was created as a subset of the performant parts of OpenGL to target embedded devices.
Q. In OpenGL I use glBegin and glEnd to draw shapes, can I do this in OpenGL ES?
A. No, you will need to use vertex arrays in OpenGL ES to draw shapes. Here is an example that illustrates the differences in drawing between OpenGL and OpenGL ES:
// OpenGL
glBegin(GL_TRIANGLES);
glVertex3f(1,0,0);
glVertex3f(0,1,0);
glVertex3f(-1,0,0);
glEnd();
// OpenGL ES
GLfloat vertices[] = {1,0,0, 0,1,0, -1,0,0}; // Stick the glVertex3f points above into one array
glEnableClientState(GL_VERTEX_ARRAY); // Tell OpenGL ES that you want to draw using vertex arrays
glVertexPointer(3, GL_FLOAT, 0, vertices); // Store your vertex in memory so that OpenGL ES can draw the triangle in the next call
glDrawArrays(GL_TRIANGLES, 0, 3); // Draw the triangle using the vertex data previously stored.
glDisableClientState(GL_VERTEX_ARRAY); // turn off vertex array mode