I am not sure but you might find this code useful
Also, it would be nice if the buffer size is set to rgba5551 instead of rgb565 because N900 has a native ALPHA Channel support.