PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

CreateSurface palm problem & more

I'm trying to load a png file into a surface, being the source in the memory with:

Code:

rv=font[0].CreateSurface (GDSURFACE_SYSTEMMEMORY,(BYTE *)xxxx,len);


being xxxx the pointer to the file in memory

but there's no way to make it work. I keep getting a "0x...070" error code, INVALID_BITMAP.

First I thought my decompression code was not working correctly, however I decided to bin2c a png file and put it embedded in the code, and supply the len parameter at the correct file length, however the function still fails to load the file. the file is about 2KBs.

It works flawlessly in win32 and pocket pc
Any hints?

TIA
Kak

------- modify
p.s. the same code but using bmps instead of pngs works perfectly too :)
Unfortunately PALM handhelds do not ship with any bitmap decoders. So the reason BMP files work is simply that we have built or own BMP decoder (which is kind of cool in that it supports RLE BMPs, and resolutions of 1, 2, 4, 8 and 24-bit depth).

We are looking into supporting more bitmap formats on the Palm in the future.
Johan wrote:Unfortunately PALM handhelds do not ship with any bitmap decoders. So the reason BMP files work is simply that we have built or own BMP decoder (which is kind of cool in that it supports RLE BMPs, and resolutions of 1, 2, 4, 8 and 24-bit depth).

We are looking into supporting more bitmap formats on the Palm in the future.


ok, no problem, however I looked at the documentation and I misunderstood that bmp,jpg and gif were supported on all platforms.
once known it's easy to fix ;)
I'll keep my problems here, I don't want to flood the forum ;)

I'm having some problems when reading the stylus, I use stylusDown and stylusUp to get the stylus messages, however the Y coord is always 640 in the release version, however it seems to work ok in the debug version!


also non gapidraw related, codewarrior is complaining of a segment greater than 64000 bytes, however it's not bigger than 64000 bytes (it's about 56000). The second time I compile the warning disapears, and the app seems to work fine (except for the weird Y coord)

and just as a rant/random thought/random question, is palm as slow as it seems to me? I think the framerate on my 400 xscale pocket pc is at least 4 or 5 times higher than the one I'm getting with the palm t3. Where's the bottleneck?

TIA
Kak
Where's the bottleneck?


1. About 50% slower memory bus speed.
2. 2x larger display
=
About 4x slower performance on the T3 in full screen mode...

Don't you just love the combination of a slow memory bus with a large display.. :)
Johan wrote:
Where's the bottleneck?


1. About 50% slower memory bus speed.
2. 2x larger display
=
About 4x slower performance on the T3 in full screen mode...


I don't even want to imagine how my 3d engine will look in my tungsten E, even abusing from armlets :)

I suppose there's no place for high framerate games in palm, isn't it? (not counting zodiac, of course)


Don't you just love the combination of a slow memory bus with a large display.. :)

:)
Kak wrote:however the Y coord is always 640 in the release version


btw Johan, any clue on that Y coord being always 640? Is there any extra examples in gapidraw so that I can test this?

TIA
Kak
Hm, strange. I looked through all the coordinate code and there is nothing that should limit the Y coordinate in any way...
Johan wrote:Hm, strange. I looked through all the coordinate code and there is nothing that should limit the Y coordinate in any way...


Hi Johan,

I just put a log in the penDownEvent funtion at GapiApplication.cpp

no matter where I point, that I'm always getting a 320 as Y coord!

I'll keep you informed about the issue. (if you have any idea/any test, just ask)

TIA
Kak


-----edited:
it seems like the penDownEvent is entering always (that's not happening in debug), even if I don't press the screen.
I found the coord problem, (well, I didn't, I just found what caused it).

I had "enums are always ints" in the compiler options release, while I hadn't in debug mode.
I don't know why but removing that works well.