PocketMatrix forums

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

PocketHAL 0.5 released

The fifth release of PocketHAL, the next generation library for Pocket PC game development has been released.

Get it fresh at: http://pockethal.droneship.com

PocketHAL can currently be seen as an alternative to GAPI and GAPI-based libraries. You though GAPI was the fastest way to do graphics on your Pocket PC? Think again. PocketHAL can often run twice as fast as GAPI and further optimizations are in the work.

What's new in the 0.5 build:

* The device's native orientation can be selected with ORIENTATION_NATIVE. Keys and stylus input won't be translated. (Input will behave as if the normal orientation had been specified.)
* The API is now wrapped in namespace PHAL. This was done to "de-pollute" the global namespace. For example, this allow users to define their own classes named "Display" or "Surface".
Hi Thierry,

Out of curiousity: Do pockethal support .png? Sorry I havent played with this yet. But will do after my X-Fighter ;-)

Regards.
denthorq wrote:
Out of curiousity: Do pockethal support .png? Sorry I havent played with this yet. But will do after my X-Fighter ;-)


PocketHAL is a framebuffer access library and nothing more. You can think of PocketHAL as an improved GAPI. As such, it doesn't provide any high-level functionality such as loading images.

If you want to load PNG images, I would suggest downloading LIBPNG:

http://www.libpng.org/pub/png/png.html
http://www.libpng.org/pub/png/libpng.html
For denthorq, and anyone else that might have similar questions...

You can equate in your mind PocketHAL to gx.dll.

You can equate PocketFrog to GapiDraw.

What I mean is that PocketHAL is the layer that sits between the hardware and the graphics toolkit. The toolkit is what gives you the functionality like graphics primitives, image loading, etc. The toolkit makes use of PocketHAL (and so could any other toolkit).

These probably aren't quite perfect analogies, and I know Thierry will expand/correct what I've said if need be :), but I think this gives everyone something close to the picture of how these pieces fit together.

I believe I've seen Thierry say he would put some work into PocketFrog when PocketHAL is a little more developed, February for some reason sticks in my mind. Thierry, what are the plans/timeframe for PocketFrog at this point?

I know speaking for myself, that is the point at which I will be interested to see what's going on in Frog land. PocketHAL on it's own doesn't do a whole lot for me right now, but PocketFrog on top of PocketHAL becomes something I'd be very interested in.
fzammetti wrote:
These probably aren't quite perfect analogies, and I know Thierry will expand/correct what I've said if need be :), but I think this gives everyone something close to the picture of how these pieces fit together.


I don't need to add anything, you are doing a wonderfull job =)
great job on PocketHAL.

nevertheless i've a suggestion to make: while i find it good that PocketHAL now uses a namespace in order not to not polute the global namespace i'd like to see the same thing for the include files too.

filenames like display.h are not that rare. :)
therefore i suggest to have the headerfiles in a structure like this:
pockethal/include/pockethal/display.h

so we can add pockethal/include to the include path and have #include <pockethal/display.h> in the code...

just my thoughts,
DANIEL
drgoldie wrote:
so we can add pockethal/include to the include path and have #include <pockethal/display.h> in the code...


Good idea, will do.
I have a question about the png loading thing. If you use libpng, dont you need twice the amount of memory to load a surface?

I know there was some problem with this at one time, I just cant remember exactly what it was.
Anonymous wrote:
I have a question about the png loading thing. If you use libpng, dont you need twice the amount of memory to load a surface?


I would suggest you read the manual at http://www.libpng.org/pub/png/libpng.html. If you have any more questions about libpng, their website would be a better place to find info.

Anonymous wrote:
I know there was some problem with this at one time, I just cant remember exactly what it was.


Short answer: this is not the case.

Basically, you use png_read_info() to read the image's dimensions (width, height, color format). If the image isn't already in 16 bits/pixel, you have to setup a color transform (again see the manual). After this is done, you create a PocketHAL surface with the proper dimensions and call png_read_image().

Note that you can also read the image one row at a time with the png_read_row() function.
Hi Thierry, couple of questions about PocketHAL.

First of all, is it ready for prime time? Can I release a game using it? I'm thinking of trying it in my first title, which hopefully will be finished next month.

Second of all, am I correct that it is free for commercial use? If I sell my game on Handango etc., I can just give you props but not worry about sending cheques? Basically, what's the license?

Finally, I understand it's just a framebuffer really. I have to load my own images, provide my own rasterization, handle my own events, etc. I guess I'm wondering exactly what I have to do. A good way of asking this is, if I wanted to port the minimal GapiDraw application to PocketHAL, what would I have to do? Actually that's a good exercise, maybe I should try that.
mlepage wrote:Hi Thierry, couple of questions about PocketHAL.

First of all, is it ready for prime time? Can I release a game using it? I'm thinking of trying it in my first title, which hopefully will be finished next month.


I'm in a similar position.... hoping to finish PocketPockets (my Pool game) in a month or so (although that could change if I get a proper job and have far less free time...)

But I've kept my code organised so that I could quickly switch back to GapiDraw, or my own minimal GAPI-based framework, fairly easily (the 3D engine and 2D blitting code should still work with any screen orientation, but it's not been tested since switching to PocketHAL)

Obviously, PocketHAL is the preferred option, for it's performance, and not having to deal with orientation or pixel format issues. But at the moment there's been no idea when we can expect a non-beta release, and what licence it will be released under...

So at the moment my Symbian port of the game has become more of a priority (If I can get it running at a good speed on a 100Mhz Series 60 phone, it should run great on PocketPCs, at least those without the MediaQ...)
You can release games with PocketHAL as-is. There is no requirements whatsoever except that you should not mess with the "banner".

If you want to release with 0.5, it's your call... It seems pretty stable and the only reported issues are with non-Pocket PC devices. The next release will fix this issue and ensure that PocketHAL runs on all Windows CE devices.

I hope to have the next version ready by the end of the weekend but can't make any promises at this point. If it is stable and works, it will be version 1.0. (And that version will include MediaQ optimizations).
ok, cool :)

Were you planning to leave the banner in it's current style for a final release?

Just a suggestion: It may look better for some if it was centred, on it's own screen (preferably with fade in/out)?

Maybe someone could design a 'Powered by PocketHAL' logo or something?... (something smallish, clean, logo + text in the middle of a black background?)
Not that a splashscreen for pocketHAL would kill me... but I just finished a pocketfrog based class that lets you fade in a small splash screen on top of the "desktop"... Going fullscreen for a pocketHAL logo would kill the effect.

Anyway, I think a full screen banner should be optional... maybe you could choose between the current one or the one you suggested similar to the way you can choose the splash screen time on PocketFrog.


Does this mean that the PHAL/Frog combo will be coming soon?
fast_rx wrote:Not that a splashscreen for pocketHAL would kill me...


I don't intend on putting one at this point.

fast_rx wrote:Anyway, I think a full screen banner should be optional...


Again, I don't remember saying I wanted to add one... In any case I don't.

fast_rx wrote:Does this mean that the PHAL/Frog combo will be coming soon?


This will be done after the next PocketHAL release... Although it should be pretty trivial for anyone to do. In any case, when I do so, PocketFrog will probably turn to version 1.0.
I for one would like to thank you for some fantastic libraries. I know I for one, and most likely most other developers, would never have been able to achieve this kind of performance on our own.
Hosed wrote:I for one would like to thank you for some fantastic libraries. I know I for one, and most likely most other developers, would never have been able to achieve this kind of performance on our own.


I agree!

I would like to especially thank you for bringing the gift of vsync to PocketPCs :)

(It's just a shame my current project is 3D and runs too slow to run vsynced....)