ReadPixels WritePixels safe outside OnRender() ?

Monkey Forums/Monkey Programming/ReadPixels WritePixels safe outside OnRender() ?

Difference(Posted 2012) [#1]
Can I safely use Drawing commands like Cls , DrawCircle etc, outside mojo's OnRender, and still expect ReadPixels() and WritePixels() to behave as intended or am I limited to doing rendering in the OnRender method() ?

I'm creating some images with code, and would like to do it in the Update but until now I've done it in OnRender()


Gerry Quinn(Posted 2012) [#2]
I don't think any problems will come from ReadPixel() and WritePixel() in particular. I would worry that the back buffer could be cleared between OnUpdate() and OnRender(), though I don't know if this actually happens.

The simplest solution is probably to make a new method to replace OnUpdate(), and call it at the start of OnRender(). Put everything in that that you would have put in the standard OnUpdate() method, and you should be be free of concerns about when you can do drawing operations.


MikeHart(Posted 2012) [#3]
WritePixel you can do outside OnRender. The rest only inside OnRender.


Difference(Posted 2012) [#4]
thanks MikeHart, makes sense.