GLBasic forum

Main forum => GLBasic - en => Topic started by: FutureCow on 2009-Apr-16

Title: Is 2D or 2D using 3D surfaces quicker?
Post by: FutureCow on 2009-Apr-16
I know with other languages, 2D doesn't use 3D graphics accelleration and therefore you're actually quicker doing 2D graphics on 3D surfaces.
There's also commands to lock bitmaps before updating them to speed up commands like setpixel if you're doing lots of updates per frame.

Are any commands quicker in GLBasic than others because of the way they're implented on the back end?
I've started work on a particle system but don't want to get too far doing it all in 2D for example if I should be doing all the particles on 3D surfaces.
Title: Re: Is 2D or 2D using 3D surfaces quicker?
Post by: Kitty Hello on 2009-Apr-16
GLBasic uses 3D hardware for 2D. That's why GETPIXEL is not the fastest. 2D graphics are fast.
Title: Re: Is 2D or 2D using 3D surfaces quicker?
Post by: FutureCow on 2009-Apr-17
Thanks for the information Gernot!

Is there any commands other than Getpixel which you would consider "slow"?
This information would probably be good to have in the documentation as a "performance tips" section.
Title: Re: Is 2D or 2D using 3D surfaces quicker?
Post by: Kitty Hello on 2009-Apr-17
No, that's probably it. You can grab large textures, quickly, but if you want to get data from the graphics card to the main ram, that's slow. SAVESPRITE is also, but that's obvious.
Title: Re: Is 2D or 2D using 3D surfaces quicker?
Post by: FutureCow on 2009-Apr-17
What about rotozoomsprite? I know 2D sprite rotation is slow in other languages (though as you've said 2D is 3D accellerated I'd guess that there shouldn't be speed issues with rotozoomsprite)?

Title: Re: Is 2D or 2D using 3D surfaces quicker?
Post by: Kitty Hello on 2009-Apr-17
on Pc it's fast. On GP2X/PocketPC and such it's slightly slower, but fast enough for most cases.