PocketMatrix forums

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

GapiDriver

Hi all,

I spent some time on this side-project I started lately. I call this GapiDriver, mainly because it's a Gapi-based class that provides a user with an access layer to Gapi.

I don't intend to start making a public graphic libary, but this is a project I'll continue to work on, and I want to know if anyone is interested to work on it with me.

I provide the full source as well as a test sample for you to try. Please read the "readme" file, it will tell you exactly what this thing is. To recap:

GapiDriver provides surfaces and a backbuffer. It acts like PocketHal does, but is a Gapi-based class. It does not include graphics library functions, it's simply a layer on top of Gapi that gives the user basic functionalities.

This is the first release, and it's still in its infancy. While I can switch between PocketHAL and GapiDriver in my current game (with #ifdef), it has not been tested outside of my office.

As for the performance, where PocketHAL renders 100 FPS in landscape mode, this first release renders at around 80 fps on my ipaq 1910. Not that bad for an unoptimized release. This gives an idea of the speed at which the Swap() method operates, not how fast the screen is drawn even if it is factored in the fps.

I want to find out if anyone else is interested in working on this project with me. If you are, download the file, test it and email me.

Here is the file:

http://www.techlogic.ca/gapidriver.zip

I love PocketHal. I made this class to help me in the eventuality that current products become unavailable, not to get in the gfx lib race.

--Eric
I would be interested in trying to figure out a few basic things GapiDraw does well such as its work on two pixels at once while blitting.

For my games I only need limited functionality such as normal and alpha blits, really nothing more besides maybe a quick font class. I really liked the format of the function calls for GapiDraw though, they mirrored the way direct X handeled things which I was familiar with.
Pejo Software - Per · 09 Feb 2004, 17:08 UTC
DillRye wrote:I would be interested in trying to figure out a few basic things GapiDraw does well such as its work on two pixels at once while blitting.


Well that isn't to hard to figure out. I have now implemented my own blitters and stuff (took about 4 working days) and operating on 2 pixels gives a small speedup ~20% on certain images (only works when source and dest is aligned), I think GapiDraw is a little faster being assembler optimized.
When doing alphablending the benefit of operating on 2 pixels is bigger, I think performance was almost doubled.

I also tried to implement a RLE surface but there I failed. That did not speedup things at all!

efortier: Would it not be wiser to do the GapiDriver if/when PocketHal gets unavailable.
RLE is also the way to go for the font rendering, the speedup is even greater, and the asm code to blit RLE fonts is very compact.

My RLE font system also add a lot of functionnalities, like alpha and additive blending, outlining, texturing, gradient, double width, dot effect (LCD style), etc...
Where did you find out most of your info on RLE surfaces? I googled for them, but I mostly find sdl links....
DillRye wrote:Where did you find out most of your info on RLE surfaces? I googled for them, but I mostly find sdl links....


SDL use a quite inefficient way to handle RLE...

I found most of them in my head.

But I was inspired by someone who said that the second fastest algo to blit a sprite was RLE (first is compiled sprites).

Never tried compiled sprites...
StephC wrote:RLE is also the way to go for the font rendering, the speedup is even greater, and the asm code to blit RLE fonts is very compact.

That's pretty amazing. I would have believed using RLE with fonts would reduce speed since the pixel runs are probably shorter than in, say, a bitmap.

RLE on large surfaces must provide an amazing speed increase, especially if using a color key?

--Eric
efortier":1a1rwpq7]

Only if using a color key or alpha sprite.

There is no point using RLE for a rectangular surface.

About the font rendering, I hope the next round of benchmark will include text rendering, so we'll se if RLE is fast :)