Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / CopyMemblock

Author
Message
george++
AGK Tool Maker
17
Years of Service
User Offline
Joined: 13th May 2007
Location: Thessaloniki, Hellas
Posted: 19th Jan 2015 17:37
How fast is it?
Can I use it, between calls of sync() function?
CJB
Valued Member
20
Years of Service
User Offline
Joined: 10th Feb 2004
Location: Essex, UK
Posted: 19th Jan 2015 17:44
I guess that depends on what machine it is running on, but here is a little test you can try:




Play with the value in blocksize to see if it affects your frame rate.

V2 T1 (Mostly)
Uzmadesign
george++
AGK Tool Maker
17
Years of Service
User Offline
Joined: 13th May 2007
Location: Thessaloniki, Hellas
Posted: 19th Jan 2015 19:02
Thanks CJB, but it would be nice if I have your opinion by your experience and your devices, because I am thinking to use this function in my main loop.
BTW: Your snipet gives me 60 FPS
Naphier
14
Years of Service
User Offline
Joined: 2nd Oct 2010
Location: St Petersburg, Florida
Posted: 20th Jan 2015 03:42
Depends on the size of the memblock and the system. It's fast, but it's sort of like asking how fast a file can be read/written. It depends on the size and the system.
CJB's example is actually slowed by calling sync every for-next iteration. Doing that will limit the speed to the sync rate whereas it can be much faster.

CJB
Valued Member
20
Years of Service
User Offline
Joined: 10th Feb 2004
Location: Essex, UK
Posted: 20th Jan 2015 11:02
The little snippet was just a test to see whether a CopyMemblock could be used every sync cycle. Try adding:

setsyncrate(0,0)

...at the top of the code so it doesn't get limited to 60 fps.

If I ramp up the memblock size to 100000000 and increase the iterations to 100000 I'm still getting well over 1000fps on a non-gaming machine using a cheap "Display Link" USB graphics adapter. I hope this helps.

V2 T1 (Mostly)
Uzmadesign
SpecTre
Developer
21
Years of Service
User Offline
Joined: 24th Feb 2003
Location: UK
Posted: 21st Jan 2015 16:53
Works well in a floodfill routine I have been working on for my Colour Splash project with no delays in filling areas with a colour.

I use it in a loop to check the pointer pressed and fill.
This has Sync commands between in the loop if that's what you mean.

Check the link for my project post for latest code.

http://forum.thegamecreators.com/?m=forum_view&t=213305&b=48

Image size is 640 x 430 with an array size of the same dimensions to store pixel values.

I am going to ramp up the screen size soon to 1280 x 800 but I can't see the speed changing.

I have had it working the same speed on a few phones and tablets now.
So far all seems good with memblocks.

Programming - AMOS on the AMIGA! / DBPro / Python / A bit of C & C++ / now also AGK2! Graphics - Deluxe Paint on the Amiga / Paintshop Pro / Photoshop / Lightroom / Grafx2
Previously worked for Prisma Software producing childrens educational software on the Amiga. Titles - Pepe's Garden - Paint Pot / Kids Academy range - Paint Pot II / Shopping Basket / Which Where What? / Blobs / Alvin's Puzzles
george++
AGK Tool Maker
17
Years of Service
User Offline
Joined: 13th May 2007
Location: Thessaloniki, Hellas
Posted: 21st Jan 2015 18:27
Thank you all for your replies.

Login to post a reply

Server time is: 2024-11-25 15:17:41
Your offset time is: 2024-11-25 15:17:41