PocketMatrix forums

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

GapiDraw v2 Released !

GapiDraw v2 was released today after several weeks of intense development and testing! New features include better .NET support, support for hardware acceleration and video surfaces, RGBA surfaces, improved Smartphone support, and massive performance improvements!

Download your copy now at http://www.gapidraw.com
Ohhhhh! Cream my shorts I did!

This is excellent Johan. Well worth the wait =)
Congrats Johan! And thanks a lot too for sharing with us your Gapidraw. :) We'll surely make good use of it and churn the best games out there using Gapidraw.

Regards,

Erick :)
efortier · 09 May 2003, 21:31 UTC — Small error in doc
Here is a small error I found in the doc:

in AlphaBltFast():

Flag in docs: GDABLTFAST_OPACITY
Flag in header: GDALPHABLTFAST_OPACITY

--Eric
Here is my report of putting this new release in my game.

It took me a while to convert all those DrawText() function. Boy do I have a lot of those!!

Once finished, the game ran without a single problem on my iPaq 3850. The speed increase was marginal, mainly because I still don't use many alpha channels in my graphics, just the main character.

And also the fact that I don't use the new features of DrawText(), which will eliminate the need to use an intermediate surface!

So, here is 3 questions:

a) In previous DrawText() we could supply the color of the system font. How do I use the system font and specify its color with the current version?

b) is GDERR_LOCKEDSURFACES the same as the old error code GDERR_BACKBUFFERLOST, which is returned from Flip()?

c) what would be the proper way to use the SurfacesAreLost() function? I'm not using GapiApplication framework, so I'm not sure when to use it.

Anyway. Thanks for this great, feature packed new release!

--Eric
efortier: look at the function RenderSystemFont(COLORREF) in the CGapiSurface documentaion. I think that is the function you are looking for.
scoreman wrote:efortier: look at the function RenderSystemFont(COLORREF) in the CGapiSurface documentaion. I think that is the function you are looking for.

Thanks a lot! I missed that one!

--Eric
efortier: Thanks for reporting in the doc error.. I'll update the documentation immediately. GDERR_BACKBUFFERLOST was previously returned if the GAPI DLL had changed the location in memory of the GAPI double buffer. The back buffer would then point to a memory area that is not valid anymore, and would have to be re-initialized. All this is now handled internally by GapiDraw, so you don't have to check for this message any more.

The proper way to use SurfacesAreLost() are at the end of each frame pass, after the flip(). If it returns GDERR_LOSTSURFACES you should call RestoreAllVideoSurfaces() and then re-create the contents of all your surfaces stored in video memory.

All this will be featured in the new HW tutorial.. Not online yet...
sbl: Thanks a lot for the above information.

Regarding the DrawText(), I really miss the easy way of setting the colors of the default font. I used different colors in a status window in order to depict various message: Red = combat info, green = exploration info, etc. And I render the status window on each frame.

Did the old way of specifying the colors in DrawText() with system font internally used RenderSystemFont()? If not, isn't the new method forcing us to make a new surface for each color we need?

The old method was quick and very easy to use.

Thanks!

--Eric
efortier: While the old system font was easy to use, it was slow and wasn't cache-optimized. I though most people was going to use it for FPS counters during development, but instead many use it in their final game for significant amounts of text.

I would not recommend re-rendering the entire system font on each frame since it's slow. The system font is included with the distribution (in the Misc folder), so you can simply use that and colorize it... Sorry for the hazzle, but the old system font was simply not a good implementation.