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 / Sequence to use back buffer twice in one frame?

Author
Message
nz0
AGK Developer
17
Years of Service
User Offline
Joined: 13th Jun 2007
Location: Cheshire,UK
Posted: 8th Jan 2013 20:53
I have been trying to do some pre-render work by drawing some stuff to the back buffer, then capturing it for manipulation and putting it back like this:



Which works fine, but I wanted to re-use the space I use for the initial "capture". I have used various clearscreen() and repeating the update() render() but no combination seems to work for me.
The image is drawn on the screen using a sprite grid, so I expect (and tried) to do another update() and render() after the ProcessMemBlockToScreen() but that doesn't work as I thought it would..

Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 8th Jan 2013 21:39 Edited at: 8th Jan 2013 21:43
How does this work for you?
I suspect you are using the latest beta?

do
Print "something"
Render2dFront()
imgID=GetImage(0,0,128,96)
ProcessMemBlockToScreen(imgID) // set sprite array up
Update()
Render2dFront()
Swap()
loop

You might also be forced sometimes to use the drawsprite command?
I dont remember it clearly as i used similar stuff for my raycaster.

do
Print "something"
Drawsprite(your sprite id )
Render2dFront()
imgID=GetImage(0,0,128,96)
ProcessMemBlockToScreen(imgID) // set sprite array up
Update()
Render2dFront()
Swap()
loop

Android 2.3 , ZTE Skate , 480x800 , 800 mhz , Samsung Galaxy Y , 240x320 , 832 mhz , Sony ericson arc 480x854 , 1 ghz
Android 4.0 , Dmtech 3g 9738B , 1024x768 , 9.7 inches , 1.2 ghz
nz0
AGK Developer
17
Years of Service
User Offline
Joined: 13th Jun 2007
Location: Cheshire,UK
Posted: 8th Jan 2013 23:58
Hi Cliff,

Yes, this is using the latest beta.
These don't work because what I'm trying to GetImage() needs to be cleared afterwards and then the other stuff (sprites etc.) drawn on the backbuffer before the backbuffer is switched.

nz0
AGK Developer
17
Years of Service
User Offline
Joined: 13th Jun 2007
Location: Cheshire,UK
Posted: 9th Jan 2013 00:08
Some combination of clearscreen() and drawsprite() does work, but now I get 20 fps

nz0
AGK Developer
17
Years of Service
User Offline
Joined: 13th Jun 2007
Location: Cheshire,UK
Posted: 9th Jan 2013 00:26
OK, a solution is at hand. I just place a black sprite over the section after I copy it and it is gone

Login to post a reply

Server time is: 2024-11-24 06:10:20
Your offset time is: 2024-11-24 06:10:20