This site is no longer active and is available for archival purposes only. Registration and login is disabled.

Which method of drawing is faster....


Which method of drawing is faster....

Postby voided » Dec 16, 2001 @ 11:40pm

I'm a new developer in Pocket PC and I wanna develop some GAPI games. I been trying to write  directly to the screen buffer with my own BltBlt function but encounter alot of problems.<br>Recently I found of a new way of drawing to screen througnt the help of the Microsoft's DIB and BltBlt. It goes like the<br><br>My sprite --(Using Windows Bltblt)--> DIB --(Using memcpy or my own BltBlt)--> Framebuffer<br><br>The good thing of this method is the I can use the Windows Bltblt to handle the loading, resizing, transparent, etc. I sure this method is slower but how much? Currently, I using memcpy for normal sprite and pixel copy for transparent and alpha sprite. If u have a better method of posting sprite to screen, please advise. Codes and example will be nice. Thanx.<br>
voided
pm Member
 
Posts: 3
Joined: Dec 16, 2001 @ 11:40pm


Re: Which method of drawing is faster....

Postby MirekCz » Dec 17, 2001 @ 2:16am

ello,<br>well, it's hard for me to say exactly how much slower it is, but I guess quite a lot. Especially the Pixel copy for transparent and alpha blended sprites is surelly really slow. The bitblt/memcpy might be not so bad...<br>They way to make it right (fast) is to use GAPI and do all your graphic functions yourself (or use a lib...) You might want to check easyce (www.pocketmatrix.com/phantom/ - go to tech page for full source download) , it is a great lib with all the initialization for GAPI and some simple drawing functions included.<br>Good luck!
With best regards,
Mirek Czerwinski
User avatar
MirekCz
pm Member
 
Posts: 269
Joined: Sep 18, 2001 @ 6:42pm
Location: Poland,city Poznań


Re: Which method of drawing is faster....

Postby R0B » Dec 17, 2001 @ 6:28pm

To put it simply, if you can use GAPI, then use it.  For instance, Quake would be completely and utterly unplayable with the wind bitblt function.  The 720 actually accelorates it, and it still is way to slow.  There are several reasons why (ok maybe only one or two), but all you need to know is that comparing bitblt to GAPI is like comparing a moped (SP) to a formula 1 racing car.
"1011001010 NNNNNNNNNNOOOOOOOOOOOOOOOO!!!!!!" -Bender
User avatar
R0B
got muffins?
 
Posts: 1894
Joined: Jun 22, 2001 @ 12:04pm


Re: Which method of drawing is faster....

Postby Digby » Dec 18, 2001 @ 12:27am

Rob, <br>I'm curious to know how much slower Quake ran by using BitBlt rather than a custom GAPI blit routine.  From what Dan has mentioned before, the majority of Quake's time is spent doing floating point calculations rather than blits.  I would think that it should only be doing one blit per frame - from the back buffer to display RAM.<br><br><br>
Digby
pm Insider
 
Posts: 1011
Joined: Apr 29, 2001 @ 1:53pm


Re: Which method of drawing is faster....

Postby simonjacobs » Dec 18, 2001 @ 7:18am

GAPI is way faster. I am just writing a general purpose gfx library to simplify bliting etc. for people who are starting pocket pc game programming. So far I have:<br><br>LoadImage/BitBlit/MaskBlit/TextOut/TransparentBlit<br><br>If you want help with gapi blitting please just email me!<br>
User avatar
simonjacobs
pm Insider
 
Posts: 311
Joined: Nov 27, 2001 @ 4:51pm
Location: London, UK


Re: Which method of drawing is faster....

Postby Digby » Dec 18, 2001 @ 2:11pm

Simon (and others),<br><br>Saying something is "way faster" doesn't carry much weight.  If you're going to provide a library of routines for people to use, that has as its primary value to be faster than the available blitting routines provided by GDI, you should post profiling results between the two.<br><br>
Digby
pm Insider
 
Posts: 1011
Joined: Apr 29, 2001 @ 1:53pm


Re: Which method of drawing is faster....

Postby MirekCz » Dec 18, 2001 @ 3:43pm

Simon:why do you code it? There's EasyCE already, you might rather want to add something to EasyCE so we have a more complete library.
With best regards,
Mirek Czerwinski
User avatar
MirekCz
pm Member
 
Posts: 269
Joined: Sep 18, 2001 @ 6:42pm
Location: Poland,city Poznań


Re: Which method of drawing is faster....

Postby simonjacobs » Dec 18, 2001 @ 3:47pm

EasyCE is a framework, I just wanted a library of functions for stuff like masked/alpha blitting. Since I am going to release the source code with no restrictions it would be easy to add into EasyCE if anyone wanted to do that.<br>
User avatar
simonjacobs
pm Insider
 
Posts: 311
Joined: Nov 27, 2001 @ 4:51pm
Location: London, UK


Re: Which method of drawing is faster....

Postby TBone » Dec 20, 2001 @ 4:13pm

I think Bitbank once tested the speed of BitBlt on PPC and found that the routine ran around 30ms. That's 3fps, not nearly fast enough for anything but board games.
3V1L L337 H3150
User avatar
TBone
pm Member
 
Posts: 434
Joined: Jul 25, 2001 @ 10:12pm
Location: Fairfax, VA


Re: Which method of drawing is faster....

Postby MirekCz » Dec 20, 2001 @ 4:18pm

I don't believe it's 30ms, really.
With best regards,
Mirek Czerwinski
User avatar
MirekCz
pm Member
 
Posts: 269
Joined: Sep 18, 2001 @ 6:42pm
Location: Poland,city Poznań


Re: Which method of drawing is faster....

Postby simonjacobs » Dec 20, 2001 @ 4:31pm

Er, I can believe GDI BitBlt is 30ms, which is 33 fps surely. 1000/30 == 33 ish.<br><br>Of course you wouldnt get 33 fps because the game would have to be doing other things too.<br><br>Maybe it is less though, the only way to be sure it to time it yourself :)<br><br>You can easily get 10ms for a fullscreen copy with a pixel by pixel copy in c++, and about half that with some optimization. Obviously to get exact figures it needs proper timing trials, but there is certainly no doubt that GAPI is faster than GDI by a large margin.
User avatar
simonjacobs
pm Insider
 
Posts: 311
Joined: Nov 27, 2001 @ 4:51pm
Location: London, UK


Re: Which method of drawing is faster....

Postby simonjacobs » Dec 20, 2001 @ 4:38pm

BTW: I was talking about an iPaq 36xx for the rough timings in the above post. The speed would of course vary wildly depending on processor speed.<br>
User avatar
simonjacobs
pm Insider
 
Posts: 311
Joined: Nov 27, 2001 @ 4:51pm
Location: London, UK


Re: Which method of drawing is faster....

Postby simonjacobs » Dec 20, 2001 @ 4:56pm

I had another thought :)<br><br>One other major factor would be the pixel format. A 256 col screen should blit twice as fast as a 4096/65000 col screen.<br><br>Anyway, I might run some speed tests on the GDI tomorrow if I feel like it. I suspect the real penalty for games with the GDI will actually NOT be the BitBlt function, but things like DrawText and the shape drawing functions which have loads of extra options you wouldnt normally need, but must take their toll on the speed.<br>
User avatar
simonjacobs
pm Insider
 
Posts: 311
Joined: Nov 27, 2001 @ 4:51pm
Location: London, UK


Re: Which method of drawing is faster....

Postby MirekCz » Dec 20, 2001 @ 5:53pm

Simon:well, if you can't get the backbuffer->frontbuffer copy in under 10ms you're having a poor start to get 24fps which is your tft screen refresh rate(as far as I know, might differ from device to device)
With best regards,
Mirek Czerwinski
User avatar
MirekCz
pm Member
 
Posts: 269
Joined: Sep 18, 2001 @ 6:42pm
Location: Poland,city Poznań


Re: Which method of drawing is faster....

Postby simonjacobs » Dec 20, 2001 @ 6:17pm

I dont really see why. If, for instance, I wanted 24 fps, that would give 40ms per frame. If the pixel per pixel copy with format conversion takes 10ms, and a full screen optimised blit takes 5ms, that gives quite a bit of time to do everything needed.<br><br>It doesnt really matter in the end, as my newest gfx routines are working fast enough that the game I wanted them for needs to be slowed down to make it playable.<br>
User avatar
simonjacobs
pm Insider
 
Posts: 311
Joined: Nov 27, 2001 @ 4:51pm
Location: London, UK


Next

Return to Windows Mobile


Sort


Forum Description

A discussion forum for mobile device developers on the Windows Mobile platform. Any platform specific topics are welcome.

Moderators:

Dan East, sponge, Digby, David Horn, Kevin Gelso, RICoder

Forum permissions

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

cron