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 / SetRenderToImage question

Author
Message
paulrobson
9
Years of Service
User Offline
Joined: 22nd Nov 2014
Location: Norfolk, England
Posted: 25th Jan 2015 08:13
Hi. The SetRenderToImage() command talks about 'draw calls' - does it mean this literally (e.g. lines as used in the example) ? Can you render sprites using this ?

I'm doing something like this, experimenting with backbuffers for tiling rather than just having lots of sprites (which works very well !)

baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 25th Jan 2015 09:00
Yes, rendering to an image is exactly the same as rendering to the screen but it puts what you would expect to be on the screen into an image. I use it extensively. 1 thing to remember is that Android requires power of 2 render images i.e.. 1024x512 or 512x512

Just remember you only need to create 1 render image not 1 every frame. Apply the image to a sprite when rendering to the screen or to a plane / quad object in 3D.


Using AppGameKit V2 Tier 1
paulrobson
9
Years of Service
User Offline
Joined: 22nd Nov 2014
Location: Norfolk, England
Posted: 25th Jan 2015 10:55
Is that why my code doesn't work - I have to apply the image while rendering to the screen, then render the sprite when rendering to the RenderImage ?
Polaraul
9
Years of Service
User Offline
Joined: 13th Dec 2014
Location:
Posted: 25th Jan 2015 12:59
This is how I usually draw a sprite to a render image outside of my main loop.


baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 25th Jan 2015 15:15
Here's the basic way I do it:
Create an image of power of 2 size
Apply the image to a sprite / object
During the loop:
Set Render To Image
render stuff
Set Render To Screen
draw the object / sprite you applied the image to


Using AppGameKit V2 Tier 1

Login to post a reply

Server time is: 2024-04-27 03:48:19
Your offset time is: 2024-04-27 03:48:19