PocketMatrix forums

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

GapiDraw 2.0 development progress

GapiDraw 2.0 (<a href="http://www.gapidraw.com">www.gapidraw.com</a>) will be released on May 1 and is currently under construction. This deadline will not be moved.

If you are interested in what is happening, and have features you would like to see included, keep watching this forum post as it is updated on a daily basis.

Some of the improvements is related to GapiApplication (multithreading will now be an option), DrawText, and hardware acceleration. Real-time RLE-encoding will be added for fast masked blits.

*UPDATE* The amount of changes (both internal and in the SDK) have resulted in the new version being called 2.0 instead of 1.10.
A solid date to look forward to :)

Artax
A great news really!!
I am developing a Smartphone game and hoping Gapidraw will provide better support for Smartphone.
:) Yep.. I'll post daily updates to this thread what's going on as well.. Keep watching this space...
Yeah! Johan lives. Looking forward to a new release.
It's really a wonderful message! 8O
I hope I can create large&safe; surfaces with the new edition! :)

Thanks Johan!!! :wink:
[Daily update - Tuesday, April 15]

Today I rewrote most of the internal hardware acceleration when running in full screen mode. The current implementation was a hack to get everything working, now it has been designed and put into place correctly. I also corrected several issues related to both full screen and windowed mode (especially full screen mode was really broken). Options for checking for lost surfaces and manually restoring lost video surfaces was added as well.

Plans for tomorrow: The usual code review of today's code in the morning, then check to see if direct display writes can be enabled in full screen mode (facilitating effects such as a 75hz mouse cursor when the frame loop updates at 15hz)... I will also start on a new nifty feature to be implemented:

CGapiAlphaSurface

Now what's this? How about a 32-bit surface with place for both image and alpha in one place.. That can read PNG images stored in 32-bit RGBA format directly! No more alpha split etc. Just one easy to use surface.. Performance will improve significantly as well. Both pixel and alpha information is read using one memory read with a minimum amount of cache lines used... Hopefully I'll have a beta build with CGapiAlphaSurface done on Thursday...

Catch next update tomorrow...
[ Need help with Smartphones ]

Right now GapiDraw works fine on Smartphones. Toki Tori and Odyssey from AIM are two fine examples of this. But included Smartphone support code be a lot better than it is now.

Smartphones are still unavailable where I live, so I could use help from those of you that have access to such devices. What I need is basically pure code, extensions to CGapiApplication to make it catch window messages such as "incoming phone call". Code that works on real devices. Code that has only been tested on the emulator is unfortunately not of interest.

Thanks for your help
//Johan
[Daily update - Wednesday, April 16]

Download latest build here:
http://www.gapidraw.com/GapiDraw110(2003-04-16).exe

(1) Hardware acceleration
Lots of improvements have been done to the hardware acceleration. Not only should it be faster but also use less resources and be much stabler than the previous beta.

(2) Direct access to the display in full screen mode
Now things are looking interesting. If your application runs in full screen on a stationary PC you can now draw directly to the display as simple as m_display.FillRect() for example. This can be used to facilitate fast mouse cursors even if the game runs at 5-10 Hz.

(3) New CGapiApplication
GapiApplication is now single-threaded. The old class was improved and renamed to CGapiApplicationMT. Change all links from "GapiDrawApplication.cpp" to "GapiApplication.cpp".

I need some help

Please try all the sample applications windowed (DEBUG MODE) as well as full screen mode (RELEASE MODE). Especially the MFC and Collision Mask applications are interesting as they use video surfaces and a backbuffer that is stored in video memory. Please try to break these applications by switching, gaming, whatever.

Thanks
//Johan

Tomorrow: CGapiAlphaSurface.. :D
As some of you will notice: the black banner is back.. This time however the final GapiDraw 1.10 will be released on time, May 1. So you may begin to test your game with the new DLL immediately.

tedson: By the way.. I added some functions for you and your BoundsChecker.. :) Check the "Functions" section in GapiDraw.h... If you call those functions, classes will be allocated by the DLL and BoundsChecker will no longer report memory leaks...
Noty · 17 Apr 2003, 10:51 UTC — Is Smartphone supported in currently released beta?
Dear Johan,

First of all, thanks for your wonderful work.

I downloaded GapiDraw110(2003-04-16).exe today and slightly modified my codes to conform to the changes.
However, I could not find the gd110.dll/lib for Smartphone platform. Should I chnage back to gd104 temporarily to avoid delaying my development progress?

Thanks for your reply in advance. 8O
Noty: Today's build will include the Smartphone version as well...
Thanks a lot Johan! I knew I had to delay my game a little more to wait for the release version of GD1.10. :) Can't wait to see CGapiAlphaSurface. I'm using a lot of alpha surfaces on my game and hope that this version improves performance.
[Daily update - Thursday, April 17]

Download latest build here:
http://www.gapidraw.com/GapiDraw110(2003-04-17).exe

I have included builds for Smartphones (ARM and X86 emulator), and the PPC 2000 & PPC 2002 emulators with this release. Test away... Better find the bugs now before the final release is out...

I have begun work on CGapiAlphaSurface and it is proceeding along well.. Should have it up and running quite soon.
Spacemonkey · 17 Apr 2003, 23:35 UTC
Hi, tried getting this working with smartphone and I get a pile of linking errors (unresolved external for things like CGapiApplication.Run()).

I think I might be using the wrong lib, what's right for smartphone? should I be using ppc-arm or tpc-arm or ????

Thanks for the help. I'm currently just starting work on a RPG for smartphone, got the graphics engine mostly done, and want to get it up to 1.10 as it's not gonna be released until after May 1st (by a long time :) )
Spacemonkey: You should use the "tpc" versions that has been compiled using the Smartphone 2002 development kit (these DLLs are also digitally signed).

In your case, the error comes from a change in the name of "GapiDrawApplication.cpp" to "GapiApplication.cpp". Remove "GapiDrawApplication.cpp" and "GapiDrawApplication.h" from your project and insert "GapiApplication.cpp" and "GapiApplication.h" instead. :)
Is there some relation between the creatsurface call with the new flags and the colorkey or has the colorkey function been changed. Because in my smartphone game on a emulator the colorkey doesn't work anymore with the new 17-4 build. This is the first time I try the 1.10 version.
UPDATE:
Found the problem. I set the colorkey before creation of the surface. That is not possible anymore with this version.
Krelis: Thanks for the report.. It is fixed in the current (not yet released) build...

*UPDATE* CGapiRGBASurface (previously CGapiAlphaSurface) is now up and working... :)
[Daily update - Saturday, April 19]

Download latest build here:
http://www.gapidraw.com/GapiDraw110(2003-04-19).exe

(1)
CGapiRGBASurface! This new 32-bit surface can load PNG images with transparency (both 8-bit and 24-bit PNGs with alpha is supported)... Check out the new AlphaBlt and AlphaBltFast in CGapiSurface... The old way is still available however, but I really doubt anyone will want to use it after getting used to this class...

(2)
Minor improvements to the new, single-threaded CGapiApplication (when the application is minimized it will now call WaitForMultipleObjects and sleep in 250ms intervals - and break if a windows message is received)

(3)
It is now again possible to call SetColorKey() before calling CreateSurface().

---------------

Upcoming features: CGapiRLESurface (for nice and quick GUI overlays), and a 4-4-4-4 surface (16-bit RGBA) for alpha blends that are 2x faster than CGapiRGBASurface... But right now I'm out of ideas of what to call it..

*UPDATE* How about CGapiSurfaceRGBA16 and CGapiSurfaceRGBA32? The 4-4-4-4 format gives 16 levels of each base color, with a total of 4096 colors. Should be enough for most uses..
for alpha blends that are 2x faster than CGapiRGBASurface

Will they be faster than 1.04 AlphaBltFast? Approximately by how much?


and a 4-4-4-4 surface (16-bit RGBA) for alpha blends... But right now I'm out of ideas of what to call it..

How about CGapiRGBASurfaceEx? I like the "Ex" naming convention used in Windows SDK. Like, it's the original but with more features.

When coming across an "Ex" function, you know the basic functionality is the same, but with some differences.

Suggestion: I hope the new release will contain some updated documentation, because demistifying the new classes could be hard!

Thanks!

--Eric
Guest · 20 Apr 2003, 10:46 UTC — spacemonkey
OK, I got my program running now on 1.10 no probs.

Anyway, currently it predominantly does a lot of .BltFast calls and not much else, (I'm gonna start using the new alpha scheme for spell effects), one thing I've noticed though, it's slower than GD104, and in fact the latest build is slower then the previous 110 build.

I have a little display up continuously at the moment telling me ms/frame so I can keep everything quick enough and between the previous and latest build it dropped about 2ms/frame, also I noticed more processing spikes, where it will jump about 8-10ms slower for a frame or 2 and then come back down.

My app is a single threaded one and currently does probably 100-150 bltfasts per frame and not much else.
Eric: Thanks for the name suggestions.. :) I'll see what I will end up with... I will fix the documentation as soon as I'm finished with the RLE surface.. I guess it will take one or two days at most...

Anonymous: Some people were having a party in the building and set off the fire alarm, so I did not have time for a full rebuild. Usually this affects performance in a negative way (I cannot even do incremential DEBUG builds any longer because the compiler will break with an error - I guess it doesn't like my huge sections of template meta code)... Please try the next build and see if performance improves - if not then I have a new topic at the top of on my todo-list.
spacemonkey · 20 Apr 2003, 15:49 UTC
OK, tell me where to look if I'm just wasting your time... but I'm really keen to get the Alpha inclusive surfaces working and loading direct from a RGBA PNG file.

Question is, what's the syntax? I can't find any documentation or instruction in the forum that seems to tell me about this. Even just a bit of sample code so I can figure out the syntax.

Thanx

PS. I was anonymous above, I've taken a cut of my app at the stage where I've moved to 1.10 so I can test the performance difference on smartphone between 1.04 and 1.10 with future releases.
spacemonkey: Your feedback is most appreciated!

Try this:

header file:
CGapiRGBASurface m_pngimage;

CreateSurface():
m_pngimage.CreateSurface(0, hInstance, IDR_IMAGE, TEXT("PNG"));

ProcessNextFrame():
backbuffer.AlphaBltFast(10, 10, &m_pngimage, NULL, 0, NULL);

As you can see it is a much nicer format than previous...

The next build will allow you to create either a 16-bit (default) or 32-bit RGBA surface using different flags in CreateSurface().
Should it now be possible to load a huge picture say 1410 x 670 x 8 at once. Because I can't get it to work without the E_OUTOFMEMORY error. I can how ever create such a surface and then use a tilemap to fill that surface but I would like to load the picture in one turn. The tilemap is 320 x 920 x 24. Is there a way or is this just wrong programming?
Krelis: Do you get outofmemory even with 1.10? 1410x670 should be no big deal... The new image loader requires almost 2.5 times less memory than the older 1.04 version (see the updated technical overview on www.gapidraw.com for more information). One tip is to create a loop for allocating large surfaces:

(1) Create large surface
(2) If failed, Sleep and try again up to n times

The Pocket PC will adjust the amount of program memory / storage memory available. This adaptaion however takes time, and its possible that the first malloc will fail and the next will succeed. Dan East made a post that this is the strategy used in Pocket Quake for storing the large 10mb level information.
Thanks for the fast response. First of all this on the smartphone platform. I tried your solution on the emulator but it didn't work. The strange thing is that when I do:
m_environmentFg.CreateSurface(0,TEXT("foreground_farmhouse.gif"));
It fails.
But when I do
m_environmentFg.CreateSurface(0,1400,700);
It succeeds.
Only on the second one I have to blt several tiles from a tile map and that is something I want to prefent.
m_environmentFg is a CGapiSurface.
Maybe there is special flag I have to use for the CreateSurface?
Aha.. You use a GIF image.. 8O Uuuuu... Don't use GIFs.. The zero-memory-overhead routines only work with PNG and BMP.
Yep that fixes the problem. Thank you.
Still irritating that the malloc doesn't succeed the first time but that could be solved by claiming a big memory heap at the start of the program.
spacemonkey · 20 Apr 2003, 21:34 UTC
Another tip for smartphone that I found today...

Look up SHCloseApps in the SDK help. What the OS does is when available memory drops below a threshold it sends WM_HIBERNATE or more agressively WM_CLOSE to backgrounded apps. SHCloseApps takes a parameter of a memory amount and if that amount isn't currently available the OS will start cleaning up now without needing to reach the threshold. (I presume this gets similar results to the work around mentioned above for pocket pc, just a bit more formally).

PS. got the RGBA surfaces working perfectly, thanks.
[Daily update - Sunday, April 20]

(1)
CGapiRGBASurface can now be either 16 or 32-bit (set using a flag in CreateSurface). Right now the performance of them are about the same (with the 16-bit 4-4-4-A RGBA version taking 50% less memory of course). I will add some more flags to AlphaBlt for more customization...

(2)
Support for incoming call minimization on Smartphones in CGapiApplication

(3)
I have decided that this really is GapiDraw 2.0 and will change the DLL and LIB versions accordingly.

(4)
I have begun working on updated documentation.

Next build will be out tomorrow or on Tuesday.... And it will be 2.0 beta... :)
[Daily update - Monday, April 21]

Since many games seem to use alpha blends I decided to try and improve performance some...

(1) CRGBASurface
Storing alpha and image information together resulted in a nice performance boost on the Pocket PC. How much? It depends on the image really... On stationary PCs with their larger cache the performance was about the same..

(2) Using LUT for multiplications
I tried rewriting the current formulas (where two multiplications are required for each pixel) with three memory lookups. I created a 4kb LUT that used 4 bits of alpha and 5-bits of color information. After some hours of tweaking I found out that the current way with two multiplications is much faster. So much for look up tables...

No new build today.. The weather is far too nice to stay indoors... :)
I was wondering if DrawText() will receive the updates mentionned on the news page.

Text opacity would sure be handy ;)

--Eric
sbl wrote:
So much for look up tables...


I've found that always to be the case. There are only few "processes" that are slower in processing time than looking up in memory, intrinsic math is not one of them.


I see LUTs used a lot for ppc things, but am unconvinced of their value. They haven't been useful on PCs for decades but people still use them.
efortier: DrawText is next on my list.. After I have finished my current(unannounced) performance optimization..
Sm!rk wrote:
I see LUTs used a lot for ppc things, but am unconvinced of their value. They haven't been useful on PCs for decades but people still use them.

One of the best use I can think of is for fixed point Sin/Cos/etc lut. In that regard it may help quite a bit.

Now, if the next generation of PPC would just have a damn floating point unit!! ;) Intel, please!!

--Eric
LUTs are just an optimization option and like all optimizations, has it's time and place. They're useful, but not as a wholistic solution to all problems. As efortier said, sin/cos/tan luts are very useful. Namely because trig functions concist of atleast a couple dozen adds/divs/muls when expanded to series form (and all computers implement them in this form).
[Daily update - Tuesday, April 22]

"leet hacking".. 8) Today I increased the performance of BltFast with key source up to 40% (this also includes BltFast + keysource + opacity, and BltFast + keysource + colorfill + opacity + whatever).. The previous BltFast always operated on one pixel at the time. The new BltFast operates on multiple pixels simultaneously. The trick was to get this to work with the current template meta programming architecture (which actually works out really well).

Performance speaks for itself. The MFC demo as re-programmed by Walter Rawdanik (owner of ZSurface, http://www.warmi.net/zaurus/blits.shtml ) in optimized ARM Assembler produced 290 sprites on each frame on the IPAQ. That is the current limit. GapiDraw 2.0 is now able to produce 270 sprites on that device. That is a mere 7% difference in performance.

AlphaBlendFast was also improved to work on multiple pixels (together with an overhaul of FillRect and a couple of other operations). As soon as I have QA'd all code I will release the first 2.0 beta (Thursday). Walter: Lots of thanks for the comments + input!

Oh, finally some further Smartphone-related changes to CGapiApplication. Thanks to all of you who have emailed!!

Image

Note: If you look closely at the image you may notice a small cosmetic error to some sprites. This was related to a small programming error and has been corrected. The correction did not alter performance.
well... isnt it possible to have a "preview" of what is changed in CGapiApplication for smartphone ? I cant wait for v2.0 and im curious about the change (especially how to handle incoming calls...)
thx
spacemonkey · 23 Apr 2003, 15:58 UTC
Um, V2.0 release is supposed to be May 1, but didn't he say the next beta will be thursday (tomorrow)? So you don't have to wait too long.

I imagine the handling for an incoming call will just be trapping WM_KILLFOCUS in the main message loop and suspending the game. I'm very glad he's adding it cos I was gonna set up a trap for it on my app just yesterday, but luckily put it off cos it was sunny.
yes im trapping KILL_FOCUS too, but im still not able to bring back my game in foreground after the call, so I wondered if the new CGapiApplication do this "properly". And I still have some slowdown sometimes, but I dont know if this is my phone, the system, my code, or Gapidraw which do that. Whats why Im so impatient for the release :)
[Daily update - Wednesday, April 23]

I have taken the time to rewrite most of the core operations, such as BltFast, AlphaBltFast and FillRect. BltFast and AlphaBltFast are now around 20-40% faster depending on data. FillRect has been "cleaned up" to allow for some nice cache re-use..

The rewriting of the core blit operations was planned for a long time, but I always felt that rewriting the core features would risk imposing errors in the rendering pipeline. It did not suit a 1.05 or a 1.1 release. With the release of a 2.0 version, there could be no better time to implement this. Thankfully it is very easy to test graphics code like this, and GapiDraw has never had any visual anomalies in previous releases.

The improved AlphaBltFast (when using separate surfaces for image and alpha) is now also significantly faster than the new RGBA surfaces.. <sigh>.. To simplify the use of the "old" alpha way I added a feature to CreateSurface: GDSURFACE_ALPHASURFACE. If you load a PNG image to a surface and set the flag GDSURFACE_ALPHASURFACE, the PNG loader will extract the alpha information stored in the image and set color values between RGB(0,0,0) and RGB(255,255,255). In other words, there is no longer a need to use the "alpha split" macro anymore, even if you use separate surfaces for image and alpha.

Now it's time for some serious testing of all the rewritten blit operations before I post the first 2.0 beta tomorrow.

stuff: It should be enough to capture WM_ACTIVATE. You never actually have to deal with SET/KILL focus. Please test the next build tomorrow and see how it works on your device.

*UPDATE* The RGBA surfaces are actually much faster when doing AlphaBlt (stretch). :D So the work done on creating them are not wasted after all!! Here are some figures:

--DESKTOP-

10 000 alpha blended sprites, AlphaBltFast (200x200)

2844 - 16bit RGBA aligned
2437 - 32bit RGBA aligned
2609 - 1.04 routine aligned
1984 - new routine aligned
2015 - new routine destination unaligned

1 000 alpha blended sprites, AlphaBlt (200x200)

797 - 16bit RGBA
688 - 32bit RGBA
1062 - separate image and alpha surfaces

--POCKETPC--

1 000 alpha blended sprites, AlphaBltFast (200x200)

4827 - 16bit RGBA aligned
5034 - 32bit RGBA aligned
5326 - 1.04 routine aligned
4030 - new routine aligned
4113 - new routine destination unaligned
can't wait :P
warmi · 23 Apr 2003, 21:04 UTC — AlphaBlit
As far as AlphaBlend performance it is possible to get down to a single multiplication per pixel if you are willing to limit your alpha value to range 0-32.

Following logic in this article
http://www.gamedev.net/reference/programming/features/mmxblend/default.asp and given aligned blit you can load 2 pixels at a time in this format:

standard 32 bit (2 pixel) register:
RGBRGB

First you separate GRB part:
_G_R_B

Then you separate RBG part
R_B_G_ and shift to the right to get
_R_B_G

Given this setup you can now do multiplication on
each register which will result in 2 multiplications
per 2 pixels.
The reason you are limited to max 32 alpha levels, is that we have only 5 bits to work with before we overflow into set of bits for another color ( these 5 bits were represented as _ in the above diagram.)

Basically you exchange multiplication for a shift/AND operation.
This can only be done on aligned pixels and works best (best performance) for static alpha blends ( alpha value is constant for the entire blit.)
warmi: Neat trick (as usual)! :) Now why didn't I think of that... ;) I should be able to reduce the number of alpha multiplications in BltFast and FillRect from three to two for two pixels (I use a 5-bit opacity anyway).. I have no doubt that the new, key sourced BltFast with opacity in GapiDraw 2.0 will be almost up to 100% faster than the old version. Very much thanks to your input.

I will be preparing the documentation on Monday next week, and will post an "implementation details" section to each operation describing how it is implemented. That way optimizations such as this will be easier to spot.
I have no doubt that the new, key sourced BltFast with opacity in GapiDraw 2.0 will be almost up to 100% faster than the old version.


I'm aroused!!!

--Eric
[Daily update - Thursday, April 24]

Download latest build here:
http://www.gapidraw.com/GapiDraw200(2003-04-24).exe


New:

(1) Improved support for Smartphones
-Use the new configuration parameter MinimizeWhenInactive to minimize your application when an incoming call is received
-CGapiApplication will now correctly hide the task bar on all Smartphones

(2) Improved support for PNGs
There is no longer any need to split image and alpha. CreateSurface now has an additional flag: GDSURFACE_ALPHA. If you set this and load a PNG image with transparancy, the surface will contain the alpha values as a gray scale from 0 (transparent) to 255 (opaque)

(3) Improved support for RGBA Surfaces
CGapiRGBASurface is the fastest option when doing stretched alpha blends (AlphaBlt). CGapiRGBASurface can now be either 32-bit or 16-bit (using a 4-4-4-a format for less footprint) using a flag to CreateSurface.

(4) Improved performance to BltFast, AlphaBltFast and FillRect
BltFast with color key, AlphaBltFast, and FillRect are now up to 40% faster. GapiDraw will always operate on two pixels simultaneously, even when color keys are being used. Best performance is achieved if both rectangles to be copied are aligned at a coordinate evenly dividable by 2, there are however also significant improvements when this is not the case. The difference between GapiDraw C++ code and optimized ASM code is now less than 7%.

Note: AlphaBltFast with separate surfaces for image and alpha is much faster than using RGBA surfaces. AlphaBlt with RGBA surfaces is much faster than using separate surfaces for image and alpha. With the new flag GDSURFACE_ALPHA both formats are equally as simple to use. Choose what fits best.

(5) Improved performance with transparent blits and rectangles
GapiDraw now only uses ONE multiplication for each pixel when doing transparent BltFast and FillRect. No lookuptable is used either. Best performance is achieved if both rectangles to be copied are aligned at a coordinate evenly dividable by 2. This was actually one of the more difficult tasks, and I spent several hours producing what proved to be 9 rows of code.

(6) Some changes
-GDABLT_<x> and GDABLTFAST_<x> flags were renamed to GDALPHABLT_<x> and GDALPHABLTFAST<x>.
-A new flag was added to CGapiApplication: MinimizedActive, that will keep ProcessNextFrame active even when the application is minimized.

There have been a huge amount of internal changes (A couple of thousand lines of new code have been written) and I have not yet tested this version to full extent. Use at your own risk. I am however extremely grateful if you do try it out, and if you do, please post any performance improvements.
--- [Important changes in next beta] ---

Right now I am feeling that CGapiSurface is getting a bit too large. If I only need a surface to use as an "image store holder", do I really need all those drawing functions in all instances?

PocketFrog solved this by separating the surface and the renderer ("rasterizer"). All drawing functions are placed in the rasterizer, which is set to point to a surface. I do not want this. I used the same approach in GapiTools and it provided (IMHO) unmanageable code.

Right now I am thinking of moving CreateSurface, GetWidth/Height, GetBuffer, and some other functions to a new base class CGapiSurface. The current CGapiSurface would then be a subclass to this, called CGapiDrawSurface:

CGapiSurface
|
CGapiRGBASurface : public CGapiSurface
CGapiDrawSurface : public CGapiSurface
|
CGapiCursor : public CGapiRGBASurface
CGapiDisplay : public CGapiDrawSurface
CGapiMaskSurface : public CGapiDrawSurface
CGapiBitmapFont : public CGapiDrawSurface

How do you all feel about this? Is this a motivated change?
Here's some food for thought, right from my mentor's own lips:

Will this new change produce faster/smaller code?

Will it make it easier for user/programmer?

Does it fulfill a need?

If the answer to these three questions is no, then you must follow this maxim: Dont fix it if it ain't broken! ;)
i've just downloaded the 2.0 Beta, and quickly test the bMinimizeOnLostFocus parameter (you said MinimizeWhenInactive, but I didnt found it, was it a mistake ?)
It's working fine, xpect the fact that I would be VERY happy, if the minimised app could come back in foreground after this... Currently, the app is minimised, then after the call, the task is somewhere in foreground. On smartphone its not "easy" to do this. (you cant click on the minimised windows, there arent minimised windows, and you cant use a task manager, there is no task manager in standard) The only thing to do, is to go to "programm" and then relaunch the appli, this one detects that its currently running, and come back, this is not really "user" frienldy for someone "standard" :)

Dont know how to do this, so I cant help you, and as you dont have this device, this should be difficult to fix :)
spacemonkey · 25 Apr 2003, 07:38 UTC
This is more a problem with smartphone than gapidraw tho... I don't think there is any way the app could validly decide, when minimized, that it was time to maximize itself again.

After the call finishes try pressing the back button, that should take you back to the last running app (hopefully your game), also remember that if you are using a homescreen that includes the MRU (Most Recently Used) plugin then your game will be there, rather than needing to go to programs menu.

Performance :
Moving from the previous beta (1.10) to this one with no other code changes I got back about 1ms/frame (on my real world smartphone it processes at about 20ms/frame, now 19ms/frame). I then tried switching the code from using RGBA surfaces to doing seperate alpha surfaces and it seemed 1-2ms/frame slower doing it that way. This could well be due to memory issues on the smartphone rather than code speed. Smartphone cache/memory architecture is very nasty. So at the moment I'm gonna stick with RGBA surfaces cos they seem the quickest approach.

I'll try and do a bit more of a performance comparison between 1.04 and 2.00 tonight.
Thanks for all the input..

efortier: Agreed.. After given the new design a "feel" for it I decided to keep things they are now. Ease of use is my top priority, which is why opted not to separate surface and renderer in the first place.

spacemonkey/stuff: Thanks for the input! Manually restoring the application I'm afraid is the only way. Interesting comments on the performance.
isnt it possible to NOT minimize the APP. Just Stop writing on the screen while phoning, then restart drawing ? In a "classic" app, the incoming call box come in top of the app, then, disapear when finished, and the "classic" app is still here. I think I've made the test with some games (even games using gapidraw) and they works like this (i will retry to confirm...)
spacemonkey · 27 Apr 2003, 14:47 UTC
I see what Stuff is saying. So currently the gapidraw is detecting the lost focus/inactive and suspending and minimizing, if it just suspends but leaves the window open then restarts if it detects a WM_SETFOCUS then it would do what stuff wants... (kinda like on a pc when you have your game open and then open another window in front, the game needs to pause until it's the front/active window, but we don't need to minimize it.)

I'm not too fussed cos at least it comes back cleanly just by rerunning it from MRU etc.
yep, it comes back cleanly. Im just thinking of "stupid" people (there ARE stupid people :)) not very aware of this kind of process. Or simply, after a long call (with your banker, your girl friend, you know what I mean :)) you can just Forget that you were playing juste BEFORE ;) So the game is left in background (it should not slow the phone, but memory isn't free...)

Hopefully, and if the system reacts like it should do, the game can be killed if ressources are getting too low, catching the WM_HIBERNATE message, am I wrong ? (which is NOT handled by the current 2.0 CGapiApplication class)

For now, the "minimize" thing should be enought for me.
spacemonkey · 27 Apr 2003, 21:05 UTC
Yeah, but then the phone (and microsofts "rules" for logo compliance) suggest that you should just leave it in background. However the application could get backgrounded for some other reason than a phone call...

As far as not handling WM_HIBERNATE and WM_QUIT (when the os sends them) you should definitely be writing these routines yourself as you probably want to save game states etc before the application terminates.

The idea then is that the user (no matter how "challenged") doesn't actually know the difference between background and quit, cos when they run it again, it either comes straight back cos it was backgrounded, or it runs, loads the game state and resumes where they were up to. The only difference from their perspective is it will load quicker if it was in the background.

Gapidraw does let you overload the windowproc function to allow you to catch these messages yourself. (just make sure you pass on any messages you don't use to the gapidraw function otherwise they'll be left unhandled)

Sorry sbl, I think we might be hijacking this thread a bit, maybe we need a smartphone background thread :)
ok that's clearer now for me... even if saving game states wasnt planned for my game and seems too hard to code it now :(

I should care about all this next time...

thanks for all spacemonkey, and sorry SBL if our discussion was "out of matter"...
stuff/spacemonkey: Thanks for the input. I think it was ok to post in this thread since it's related to the development of GapiDraw.

Not much today otherwise.. I added HW support for mirror left/right + up/down. I added two functions to CGapiSurface: ColorrefToNative, and NativeToColorref for easy to use color conversions. I also created a new sample application: TileDemo, which basically is the DirectX demo of a simple Tile Studio application ported to GapiDraw (available at http://tilestudio.sourceforge.net/ ). I also created GapiDraw export filters for Tile Studio which is now included with the GapiDraw distribution. Finally, a minor visual error related to the new AlphaBltFast routines was corrected.

The next release will be on Tuesday.
Fuge · 28 Apr 2003, 08:01 UTC — Clipping in 2.0
First of all, GREAT work on this new release, Johan!! I can't wait to use it!

I wondered if there was any kind of "partial-sprite" clipping in this new release...and by that, I mean the kind of clipping where a sprite can be partway off the screen and still be visible. I know up until now, everyone has just been manually adjusting the clipping rectangle...but with how good you are at optimizations, you may be able to find a quicker way to do it...I wondered if that might be something you might be packing into this next release. :)
Fuge, what about all the stuff that doesn't need to be clipped? Do you really want to add the processing overhead to every sprite on the screen even if there is no way for it to go out of the screen area?

Honestly, clipping is a very trival/simple function to impliment. Its especially easy with the way GapiDraw handels surfaces using RECTS. If you need help on figuring this out, just ask and Ill be happy to point you in the right direction.
Will GAPI 2.0 be making use of the MediaQ MQ-1100 graphics chip used within the HP iPAQ 5450?
jacob:

If HP would release an SDK for the chip, hardware support could be added to GapiDraw 2.0 in a matter of hours. The new core is even prepared for 3D libraries with a prototype orthagonal view / billboard surface engine already being implemented. Of course there are other limitations to using a 3D bridge (such as surfaces only capable of being power-of-two in size). But give me a handheld computer with a Direct 3D SDK and you will have GapiDraw with accelerated blits and alpha blends within a couple of days.

As it is currently, the chips used in today's Pocket PCs are only useful for video decompression and some Device Context drawings using GDI. This is unlikely to change before the next version of Pocket PCs (not Pocket PC2003, the one after that) is released.

PS.. Good thing this version is "GapiDraw 2"... Lots of things can happen before "GapiDraw 3[D]" is released... :)
Here's a late suggestion for a project we're working on.

We need to load 1 bit png files to act as a mask. It would be great if there was a way to load this mask into a CGapiSurface, but if the surface wouldn't be converted to 16 bits or whatever it is converted to.

In this project we don't draw into/from the surface, but we just probe some pixels for 0/1 in response to the user tapping on the screen. The surface needs to have the same alignment as the screen.

I can implement this code, but it would be nice to have it included in GapiDraw, expecially since all the loading of surfaces is already done.

Thanks!

--Eric
The exception to when clipping is hard is when you are rotating the images when you draw them. Other than that clipping is easy.
Tully: Have you tried recompiling your game with GapiDraw 2.0? Any performance improvements? Or are you awaiting the final release`?
Yes, I have. I have only tested for bugs so far and not done timings. Everything seems to be running smoothly on the platforms I have tested (MIPS, ARM, Win2k, WinXP.)

I'll see if I can run some timing tests and let you know what the performance looks like.
sbl: I have downloaded gd200, installed and integrated it on my game, changed my project settings and pointed to the new lib, without making any modifications in my code, my game increased upto 2 FPS (which is very significant for me). I'm sure it will increase its performance even more if I implemented some of the optimizations you mentioned regarding alpha surfaces and reducing image color bits.

Questions:
1. I would like to use the singlethreaded mode (because in gd104, mine is set to multithreaded), do I have to change back my project-->settings-->c/c++-->multithreaded to single threaded?
2. Will you update the documentation soon?
3. When will the new build be released? Some of my images has some pixels missing like what you showed a few posts ago. I downloaded the Apr 24 build.
4. Can you post a brief summary on how do I take advantage of the CGapiAlphaSurface? I would really like to use the faster alphabltfast function in this version.

Other than this, gapidraw really rocks! Thanks for improving it more! Can't wait to see the final version.
egarayblas: Thanks for the feedback!

Right now GapiDraw 2.00 is compiled and finished.. It's the documentation that's taking longer to finish than expected. I am currently not sure if I should release today with a non-finished documentation, or possibly push the release until Sunday and do a rocking documentation (highlighting how to use the new hardware acceleration features, optimizing alpha blend, using the new Tile Studio exporter etc).

I have recently finished work on DrawText and CGapiBitmapFont which is now kind of neat. Full access to ALL BltFast options in DrawText.. AND International font support (so you can provide German and French versions of the games). I have changed lots of stuff related to text drawings...

I also have some other surprises going on which will not be announced yet.. But wouldn't it be cool if CGapiApplication + GapiDraw could run on other hardware?

As for your questions:
1. I would like to use the singlethreaded mode (because in gd104, mine is set to multithreaded), do I have to change back my project-->settings-->c/c++-->multithreaded to single threaded?
A: No, you don't need to change anything.

2. Will you update the documentation soon?
A: Yes. I am working on it right now. There are so many new features in GapiDraw 2.0 and I really want the documentation to highlight them all.

3. When will the new build be released? Some of my images has some pixels missing like what you showed a few posts ago. I downloaded the Apr 24 build.
A: I'll send you the final build so you can try it out. Let me guess that you only saw this on some AlphaBltFast objects.

4. Can you post a brief summary on how do I take advantage of the CGapiAlphaSurface? I would really like to use the faster alphabltfast function in this version.
A: You will get the highest performance boost if all rectangles to be copied (dest, source, alpha) are located on EVEN coordinates ((x/y % 2) == 0). You don't need to change any code for the optimized AlphaBltFast code to work.

//Johan
Thanks for the quick reply!

Yes, the missing pixels only happen on all AlphaBltFast/s. I'll be looking forward to the documentation, no need to hurry though, we're not pressuring you on this one. :)

Anyway, my game Tower Mogul is really running much faster with the new version. It uses a lot of AlphaBlts and Rectangle effects. I'm very excited to try out the CGapiBitmapFont because my game takes advantage of font effects too. Let us know once you have the final build and the docs out. I'll be visiting this thread often.

Thanks a lot Johan!

Regards,
Erick :)

I also have some other surprises going on which will not be announced yet.. But wouldn't it be cool if CGapiApplication + GapiDraw could run on other hardware?

//Johan


I read your post again and missed this one. Really? Did you mean Symbian and Palm devices? :) More power to gapidraw!
yes you should publish the final version, with the new "unfinished" documentation online, thats my point of view :P
Johan, can you make this a sticky thread? It has a ton of useful info in it, and it would be nice to be able to reference it regardless of where you are in the forums. -- GR
Ok, I'll change it to sticky once 2.0 is out and this is not a news item any more...
DigY · 01 May 2003, 13:29 UTC — release today
Johan, please, release today, without documentation.
Ok, we'll do it like this:

I create i final version (still with banner) today.. This one even supports dual displays (you can choose to use a secondary display if it is available using GDOPENDISPLAY_SECONDARY - if no secondary display is available GapiDraw will fall back on the primary display).

As soon as tedson and egarybias give a "go" - that this final build works OK with AlphaBltFast and dual displays, I will recompile the final version. And release without documentation.

I will then update the distribution online as documentation is getting updated.
that sounds good :)
sbl wrote:
As soon as tedson and egarybias give a "go" - that this final build works OK with AlphaBltFast and dual displays, I will recompile the final version. And release without documentation.


Ok with me! You can release the final build! :) I'll just wait for the docs to come out while tinkering with the latest build. Oh, and I agree that this thread should be set to sticky. There're lots of info here that are beneficial to gapidraw programmers.

Question: What's with the dual displays? Forgive me, but I'm not familiar with using dual displays. What are the advantages and where is it used?
Ok, here's the status:

I have found an issue on all Palmax @migo devices with GapiDraw. The device incorrectly reports that the display is double buffered, while it in fact is not. I am incorporating the change into GapiDraw 2.0 now, but need time a few more hours to test it.

I will publish the last version with banner early tomorrow. Give it a real hard time. If it works perfectly on the @migo, and has no issues with AlphaBltFast (it shouldn't have) it will be the final release.

Sorry for the delay, but I want this release to be a really good one.
take all your time, and give us a GREAT release :)
Johan where is the link to the version that supports dual displays? I will check that out tomorrow during the day. Also what is expected behavior if you have three displays (which I do on one of the test machines.)
tedson: Unfortunately I had to remove the code for multiple displays from the 2.0 release. It was basically too much code involved to release without testing it thoroughly (the sample code I got only shows how to setup both primary + secondary displays simultaneously - there are several issues in only using a secondary display).

It will be in the next point release though (2.01), so one can debug in full screen mode on a secondary monitor. A feature I want for myself in a current project.. So it won't be that long until release. But right now (due to lots of reasons) I really need 2.0 out the door. And I need it to be really, really stable (also due to lots of reasons)..

//J
Stable is much more important. I can wait on that. BTW, using primary + secondary together would be even better for me than using them separately.
Tully: Great! I will release the final release candidate in an hour or so. It has some changes to DrawText (support for international characters among other things). If you have the time to recompile PocketWar for it and can verify that DrawText works fine (and Erick verifes that AlphaBltFast works fine) we have a release tomorrow morning...
[Daily update, Friday May 2]

Ladies and gentlemen, we now have a release candidate!

http://www.gapidraw.com/GapiDraw200RC1.exe

Changes since last beta:
-Screenwidth / height was reported incorrect in the Smartphone emulator - the entire GDI interface for emulator environments was rewritten.
-New function: CGapiSurface::ColorrefToNative()
-New function: CGapiSurface::NativeToColorref()
-Fixed minor visual artefact in AlphaBltFast
-Hardware support for GDBLT_MIRRORLEFTRIGHT and GDBLT_MIRRORUPDOWN
-TileStudio export script included in "misc" folder
-New sample application: TileDemo
-Greatly improved CGapiSurface::DrawText (full support for all BltFast flags, system font is now pre-rendered for improved performance)
-New function: CGapiSurface::RenderSystemFont to re-render the system font with an alternate color
-Major improvement to CGapiBitmapFont::CreateFont - you can now choose what characters are enclosed in the font + there is full international support as well!
-Changed CGapiSurface::SaveSurface function call
-Some internal fixes to CGapiApplication (previously did not post correct mousemove coordinates when display is rotated, previously did not check for lost surfaces when suspended, added support for MinimizedActive in CGapiApplicationMT)
-Significantly improved performance to FillRect on stationary PCs (using improved 16/8/4/2 loop unrolling)
-CGapiCursor now subclasses CGapiRGBASurface and reads PNG images with transparency.
-SDK change: alpha blends now require a gray scale alpha surface (not only green component as earlier)
-FIX: All GapiDraw versions previously had issues with the Palmax @migo device (which has a bad GAPI implementation). GapiDraw and GapiDraw-applications will now work on these devices as well. An update to GapiDraw 1.04 (1.04b) will be released on Monday.

I think that was about everything.

I need help to test:

(1) DrawText - I know it's a pain to change all your function calls. I am sorry about that. But the new format is just so much better.
(2) AlphaBltFast - Erick, give it your best shot.
(3) The Pocket PC emulator. Anyone using the current build with the emulator please give this one a try.

After I have received OK that DrawText & AlphaBltFast works OK I will recompile this version without a banner tomorrow.

Thanks for your help!
//Johan
I converted over the fonts in Pocket War and it seems to run fine on the desktop pc. It will be about 10 hrs before I am at a location where I can test the Pocket PC version.
One thing that is strange, is that (on the PC) the window size remains the same when you rotate the orientation. This means that I now have to turn my head 90 degrees to see whats happening :-(. In the old version, when you rotated, the window size changed.

I definetely prefer the old way, it is quite hard to test swapping between portait and landscape now.
Ok. I will let you know in a few hours how my improved alphablt goes. :) Just to clarify, I'm currently using the old way of alpha blitting. My PNG images are composed of the source image and the alpha image. What I did was just replaced my old gapidraw libs with the latest version and the alpha blits showed some missing pixels. Can you explain briefly the changes I have to make on my images and the proper call on the AlphaBltFast function in this version of gapidraw?

Downloading latest build now...let you know about it when I get home tonight.

Question: My SaveSurface does not work anymore. What do I have to specify on the dwFlags parameter?
I converted Jack the Uni-Psychle to GapiDraw 2.0 and my text no longer works correctly. If the text I print has a space in it.. it prints nothing after the space so I just get the first word. I use the Advanced Bitmap Font. Any idea what the problem is as it worked fine in Gapidraw 1.04?

-Tim
www.discordstudios.com
I replaced my old gd files with the latest build and I got these errors:

tm.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: long __thiscall CGapiBitmapFont::CreateFontA(unsigned long,struct _GDFONTFX *)" (__imp_?CreateFontA@CGapiBitmapFont@@QAEJKPAU_GDFONTFX@@@Z)

tm.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: long __thiscall CGapiSurface::DrawTextA(unsigned long,unsigned long,char const *,class CGapiBitmapFont *,unsigned long,struct _GDTEXTFX *,unsigned long *)" (__imp_?Dra
wTextA@CGapiSurface@@QAEJKKPBDPAVCGapiBitmapFont@@KPAU_GDTEXTFX@@PAK@Z)

tm.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: long __thiscall CGapiSurface::DrawTextA(unsigned long,unsigned long,char const *,unsigned long,unsigned long,struct _GDTEXTFX *,unsigned long *)" (__imp_?DrawTextA@CGa
piSurface@@QAEJKKPBDKKPAU_GDTEXTFX@@PAK@Z)

tm.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: long __thiscall CGapiSurface::SaveSurface(unsigned long,char const *)" (__imp_?SaveSurface@CGapiSurface@@QAEJKPBD@Z)

Debug/TM.exe : fatal error LNK1120: 4 unresolved externals
Error executing link.exe.

TM.exe - 5 error(s), 0 warning(s)


Help please. What changes do I have to make on these functions? Do I have to reference anything again?

UPDATE: THE ERRORS ABOVE HAVE BEEN FIXED ALREADY. Please ignore this post. :) Thanks to tedson!
Look at the sig for those methods in the gapidraw header file. (gapidraw.h) The font now takes in a colorkey (so you don't have to do that on the surface any more) and the draw text now takes a extra set of parameters to let you pass in opacity, etc.

JOHAN: I tried running the latest version on a windows 98 machine and it won't run. When I open the display gapidraw throws an error (something like) "this display does not support 640x480x16bppx60hz" It doesn't matter if I change the resolution, frequency, anything, none of them work. The display does support 640x480x16x60 btw. I started checking back and the interim version you gave me had this same problem. I have been shipping a broken Pocket War and didn't know it. :( It looks like 1.04 is ok and if I run in window mode rather than full screen everything is ok.
Oh, I forgot to say...

The ARM version of Pocket War checks out. The font stuff seems to be working for me.

I am not having any problems with the text on ARM, XP and 2000 (and my text does have spaces in it.)
Are you using an advanced bitmap font?

Would you mine posting an example of how you created the font and then an example of how you draw it?

-Tim
Discord Studios
sbl: the alphablt works great now! :) i'm showing an image of my tests as a proof. please ignore my previous errors.

tedson: thanks for the tip! the errors are all corrected now.

Image

However, I noticed a small problem in drawing rects with opacity. Previously, I had a splash image that I covered up with a full screen rect that changed opacity gradually to kinda show a "fading" effect on the splash image. But in this version, the image flickers first before doing the "fade effect". Any ideas?

Other than this, everything works fine on the new build. :D
Spock wrote:
Are you using an advanced bitmap font?

Would you mine posting an example of how you created the font and then an example of how you draw it?


Hi Tim,

Try using the included MetalShard fontmaker in the gapidraw folder and you won't have any problems with integrating advanced bitmap fonts.

Regards,

Erick :)
Well my font works fine in GapiDraw 1.04 and it is in the correct format. Do you think it could still be the font?

-Tim
Discord Studios
Up and awake again... :)

MrX: I know it's a bit of pain when you rely on rotating the display a lot.. But the new format is more consistent - and also provides much better performance than the old one. Hope it's not too hard to use...

Spock: If possible, can you email your font to me so I can give it a try? johan.sanneblad@home.se . It should not stop printing after a space, and if it worked previously then something is wrong.

tedson: Thanks, I'll have a look at the display functions immediately. Good thing the font works.. The new font support will be nice since it will help in providing German and French localized versions...

egarayblas: Thanks a lot for the screenshots! It was broken exactly where I found the issue (where destination pixel is un-even (1, 3, 5, etc) and two source pixels are copied, but only the second one is anti-aliased - breaking the first one - lots of optimizations going on there). I stepped through all the new code 3 more times yesterday (phew) and am beginning to feel confident with it again.. I'll have a look at the FillRect function - which also had its share of optimizations (I found out that using 16x loop unrolling improved performance up to 250% on stationary PCs - on Pocket PCs the difference to the old 2x unrolling is almost nothing)... Finally, I guess you got SaveSurface working? I changed the syntax code to be more consistent with the rest (CreateSurface has flags first, all other functions have flags last, except for return values that are always placed last). By the way.. It was the old way of alpha blitting that was improved the most in performance.. If you use even X and Y coordinates (0, 2, 4, and so on), GapiDraw will copy two pixels simultaneously (GapiDraw surfaces are always DWORD-aligned in both directions, X and Y).
sbl: SaveSurface works great! - and thanks for the PNG support. The only weird thing I've found so far is that fillrect/opacity issue. I reckon the final build won't have that gapidraw "boot screen", right? :) I can't wait to see the final build and docs. Oh, and that "surprise" announcement you've mentioned too. ;)

spock: The new createfont method requires the strings on your bitmap font in correct order (as the first parameter), have you inspected if you missed any character? I created my own font too and it worked well in the new version.

Thanks!

Regards,

Erick :)
egarayblas: The final version will actually have a bootscreen that is 5x taller than the current (widthx120 pixels), and contain pictures of selected Swedish bikini models. It can be altered by passing the flag GDDISPLAY_MALE. :)

Oh well.. Back to checking the font routines...
That boot screen could potentially increase my sales. :)
:)

By the way.. Lots of people have asked for clipping integrated in GapiDraw. I actually had a version of GapiDraw with clipping implemented, but decided to remove it. Why?

(1) Adding clipping is simple. Implementing it in a function "DrawTiles", or "DrawSprite" is no big deal.
(2) It will impose some difficult issues with some future functionality (like antialiased drawing functions).
(3) If clipping does occur, I would like to know that GapiDraw has clipped my objects (e.g. if the bitmap I pass is one pixel too wide for the surface). While the clipping itself does not impose much overhead, blitting an odd-width bitmap is slower than blitting an even-width. So basically all blit operations would have to return GD_OK -or- GD_CLIPPED if clipping has occured.. And that is getting quite ugly (since much code does not use "FAILED(operation)", but instead use "GD_OK !=(operation)". And that means that code will fail in such an update.

So.. I guess we're stuck with having to implement our own clipping.. The good part is that it can be done quite easily.
tango4 · 03 May 2003, 15:25 UTC — AlphaBltFast
AlphaBltFast, not sure if it's my surfaces or my Blitting that's wrong but no way can I get any output from it so until the docs come out I'll stick with regular AlphaBlts.

Still I'm not complaining, gapidraw is a tremendous piece of work. I have upgraded to 2.00 release candidate and it runs very well on the iPaq and my Axim pro ( pity the Dell is half speed compared to a tatty old 3630 iPaq! )

ian
sbl wrote:
egarayblas: The final version will actually have a bootscreen that is 5x taller than the current (widthx120 pixels), and contain pictures of selected Swedish bikini models. It can be altered by passing the flag GDDISPLAY_MALE. :)


Lol! In that case, remind me to update my old games to gapidraw v2.0 as well, when you release the final build! :wink:
Why not simply have a separate function ClipRectToScreen, or ClipRectToBounds.

Most of us will have to have to impliment it anyway, it might as well be in the library :-)
spock: The new createfont method requires the strings on your bitmap font in correct order (as the first parameter), have you inspected if you missed any character? I created my own font too and it worked well in the new version.


Thanks! That fixed it all up!

We have any idea on a release date for the final? I'd like to release my patch ASAP.

Thanks everyone for the suggestions.

-Tim
DiscordStudios
spock: ASAP. :) I want the Win98 issue Tully reported to be resolved as well... I would guess Monday.
it should be so great :)
(back home again)

Tully: Thanks for the help resolving the issue with Win98 systems...

Erick: Thanks for reporting the FillRect issue. It has been fixed...

So... Here it is .. A special "PocketMatrix edition" of GapiDraw 2.00 without the documentation.. I'll do the official web release next week when I have all the docs finished...

[GapiDraw 2.00]
http://www.gapidraw.com/gapidraw200.exe
http://www.gapidraw.com/gapidraw200.zip

Final changes since RC1:
-Now works in full screen mode again on Win98 systems
-Fixed a bug where setting dwOpacity to 255 would cause FillRect to do nothing.
-New flag CGapiApplication: config.bUseVSyncAsFPS - for smooth 1:1 action in full screen mode (see the updated TileDemo application)
-Removed the flag GDDISPLAY_NOVSYNC
-New function CGapiDisplay::SurfacesAreLost() to check if video surfaces have been lost. It will return GDERR_SURFACELOST until CGapiDisplay::RestoreAllSurfaces have been called.

Thanks a lot for all the feedback!! GapiDraw 2.0 wouldn't be what it is unless all of you had helped!Thanks!

Tim: Best of luck with the new patch of Jack, it'll be the first 2.0 release out there (Unless tedson beats you to it with PocketWar)... :)

I'm going out for some beers now!

//Johan
Clipping is highly application dependent. GapiDraw shouldn't be doing this for you. Look at how DirectDraw's clipping worked. An engine that used DDraw clipping modified to use it's own clipping generally saw 3 fold performance improvements or better.

It's a fairly simple function at it's root, but your game may not need to clip in both X and Y directions, etc. These are optimizations you can make when you roll your own that a GDraw version wouldn't be able to account for.
I agree with Hosed on clipping. My clipping functions had to be tweaked for a dynamically moving camera (origin). I need to clip based on movement (up/down/left/right) in a single direction at a time, so a general clipping function won't work for me.

What could be a beneficial project for many of us is the creation of a PocketPC/Smartphone targetted Open Source game lib. Clipping, graphics, sound, etc. It could provide plenty of helper functions for various aspects of gaming on mobile platforms.

I would be happy to initiate this project, however our game isn't finished yet... (I can't find anyone able to make good looking graphics!)

--Eric
sbl: you deserve a break and some celebration! :) If you need help, just drop me a note and I'll be glad to assist. on the other hand, i still can't keep my mind off about that "announcement" you mentioned a while back. i really hope gapidraw will run on top of other platform sdks as well. :)

efortier: drop me an email, i think i maybe able to help you on the graphics department for your game. just give me more info about your game and any timetables you may have. for more info about my work, you can visit my website. :)
Jack the Uni-Psychle 1.1 is live now and works great with Gapidraw 2.0. Thanks for another great release!

-Tim
www.discordstudios.com/jack
I am updating the package and will publish it again soon for download.

I would recommend that all of you who downloaded the 2003-05-03 package re-download this new one when it's up...
Guest · 05 May 2003, 16:40 UTC — Down?
Hmmm. The links appear to be down - is anyone else having this problem?
Yes. I removed it. Apparantly no-one tested any of the release candidates with MIPS-devices, so when I cold-started my Cassiopeia E115 there were several issues...

It'll be up again soon.
Has anything changed in the CGapiApplication .cpp and .h files from RC1 to Final? Thanks :)
anon: yes
Noty · 06 May 2003, 10:46 UTC — Can not use soft keys in SmartPhone 2002
Dear Johan, before you release the "really" final version of GapiDraw, I want to remind you soft keys don't work in the version that I downloaded two days ago.
Noty: They work on my devices (3800, E115, 528, e740). What device are you using?

The MIPS issue has been resolved.. Unfortunately I won't have time to put the release together until Thursday. It will be 2.01...
tango4 · 06 May 2003, 10:52 UTC — Vka Vkb Vkc
I suspect he may have the '91 keycode' return problem. Between my dell axim and ipaq I get differing codes returned for keys.

Ian
Sorry for Johan and tango4, I corrected the previous post. I use SmartPhone 2002 emulator and don't know how to use soft keys. Sorry for all, I know it's impossible to use soft keys now.
Noty: Here are the keys for the smartphone (from the modoco web forum):
up, down, left, right 38,40,37,39
action 13
Softbuttons: left,right 112,113
dial 114, hangup 115
home 91, back 27 (which coincidentally is escape on a pc) numbers 0-9 are 48-57
* 119, # 120
vol+ 117, col- 118
Voice record 121
dont know why, but on a REAL smartphone
vkA and vkB are the softkeys, and vkC is the "*" button, on the emulator, you're right, it's 1 2 3 button.
stuff/Noty:

There is a bug in the Smartphone 2002 emulator in that it won't post any WM_KEYDOWN events if one the following keys are pressed:
Hang up, Softbutton1&2, Home, Back

Keys that work:
Dial, Up, Down, Left, Right, Action, 0-9, *, #

I'll keep the mapping to keys 1-3 in the Smartphone emulator and post this as another "known issue" in the release notes...
Would it be possible to get a copy of the old PocketMatrix build before thursday? I've got some 98 machines to test in fullscreen with the newer 2.0 code, and it'd be great to get that underway. I understand if that's a pain though :P

Thanks!
Jimbo: Sorry, but this time it's time for the grand release, and I need some time to finish the web and documentation... I will also be out-of-office most of the time tomorrow...
Johan,

When you put the documentation pages online, can you leave a link for the 1.04 docs as well? I find myself using them online more than I do locally.

Thanks!
ppcStudios: Sure, I'll do that!
Just wondering what the new ETA is?

-B
Johan,

I noticed that the gd200 dll (for PPC-ARM) is now 300+ kb in size. Is there any chance this could go down a little more?

Thanks,

Erick :)
brendan: Yesterday.. :) It's finished, I'm currently working on the docs.. It'll be up in a few hours...

eric: I could probably do some work on libPNG.. But it's not my top priority.. I don't think I could get below 250kb anyway (there's actually lots of code in there)...

//Johan
I'm sorry I didn't get to spend too much time testing out GapiDraw 2 before release. I wish I had becuase I found a few bugs - at least what I believe to be bugs. Using the Simple demo, set up the config structure like this:

Code:

config.hInstance = hInst;
config.pAppTitle = TEXT("Simple");
config.dwWindowIcon = IDI_APP;
config.dwDisplayMode = GDDISPMODE_ROTATE90CCW;
config.dwDisplayWidth = 320;
config.dwDisplayHeight = 240;
config.dwTargetFPS = 30;


Now, build and run on both the desktop and ppc device.

On the ppc device you will note that the display is as the documentation shows it. It is rotated, and in Landscape mode. This is bug #1 - the rotation is really turned clockwise, not counter-clockwise. This is an inaccuracy in both the documentation and the ppc build.

Next, on the desktop its even more strange. The rotation is counter-clockwise 90 degrees, BUT it is not in landscape mode as the ppc build was, but rather it is in normal mode, just rotated.

This may be as intended, but it is 1) highly confusing, and 2) not performing the same actions on the desktop as it is on the ppc device.

Maybe there's something I'm doing wrong in setting up the config (I've been doing 18 hour coding days for the last couple of weeks, so I'm a bit tired) but it seems to me the mode setup isn't correct.
Hi Garry,

#1
If you try the straight "Simple" demo without modifications on your device, does the text it shows match the display alignment? If it does, then the issue is not within GapiDraw (it should work!). :)

#2
On the desktop, this is as it should be. You normally always want to use the GDDISPMODE_NORMAL display mode on stationary PCs. The old concept with "landscape" modes was removed, to make GapiDraw as generic as possible.
Sorry for the previous message. After looking at it again (with a bit of sleep before hand) bug #1 doesn't exist. The rotations are correctly named.

As for bug #2, I understand the reasoning for the way its implemented now, but it still causes confusion - primarily because you need to define the display mode as normal at all times on the desktop and adjust the display sizes if you want to develop an app that works in landscape mode.

It will take some getting used to...