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 / Lock Pixels, Get Pixel Pointer, Copy Memory... Feasible in AGK?

Author
Message
xCept
21
Years of Service
User Offline
Joined: 15th Dec 2002
Location:
Posted: 7th Jan 2013 00:45
I've been playing around with the new memblock commands to study their speed and limitations especially on mobile devices. Three commands that I often use in DBPro alongside memblocks, to vastly speed up the processing and display, include Lock/Unlock Pixels, Get Pixel Pointer, Copy Memory and their related commands.

With such commands in DBP it becomes possible to manipulate image data in real-time and output the results directly back to the screen without having to first convert the memblock to an image or vice versa. Lock Pixels likewise dramatically improves performance when drawing to a bitmap before displaying the results.

The main bottleneck of the image-related memblock commands in AppGameKit comes from translating memblocks to images and back (e.g., CreateImageFromMemblock()). It is sufficient for loading and manipulating textures, but not if trying to do so on-the-fly during a game especially with larger textures. Without knowing anything about the inner workings of those commands in DBP (DirectX) I was wondering if it'd ever be feasible to migrate those commands over to AppGameKit (OpenGL) for faster 2D manipulation?
Paul Johnston
TGC Developer
22
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 7th Jan 2013 14:26 Edited at: 7th Jan 2013 14:27
In OpenGL ES there are three ways that I know of for modifying an image.
1) updating the entire image after the changes, AppGameKit does this with CreateImageFromMemblock
2) updating a rectangular region of the image after the changes, AppGameKit does not do this as it doesn't track which pixels are modified in the memblock.
3) bind the image to the render buffer and draw to it using DrawLine or sprites, AppGameKit does not yet support this.

Each method is faster than the previous and I hope at some point that AppGameKit will support the third and fastest method. Note that you can keep the memblock active and keep using CreateImageFromMemblock to update the image instead of using CreateMemblockFromImage again.
bjadams
AGK Backer
16
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 10th Jan 2013 00:17
Really nice to see a commitment to always improve AppGameKit and put in faster image manipulation options
tornado
19
Years of Service
User Offline
Joined: 21st Jul 2005
Location:
Posted: 10th Jan 2013 08:21
Quote: " bind the image to the render buffer and draw to it using DrawLine or sprites, AppGameKit does not yet support this."


Mmmm... that's what i'm dreaming about

Login to post a reply

Server time is: 2024-11-24 05:35:08
Your offset time is: 2024-11-24 05:35:08