ray
ray copied to clipboard
How to render a Drawable only once ?
If I write a render block like: render { |win| win.draw shape }
then it looks like everything in it it's continuosly redrawn to the screen? If I put a debug puts line in it, it will continuosly output to console.
This sucks a lot of cpu for static scenes which just need to be drawn once.
Is there a way to specify wheter something will be rendered just once or it will continuosly be re-drawn, like in most game/graphics framework where you have a main and a update function?
Hey,
Indeed, the render block will be called at every frame. If you have a lot of static geometry to render, you can store it in an image (rendering it on an image target only once).
Did you actually run in a situation where this behaviour caused an issue?
It's been 7 years so I can't remember! :) I'm replying now as I don't think it was polite to leave your question unanswered :)