Forum Discussion
TheEndless
11 years agoChannel Surfer
"dev42" wrote:
So, instead of drawing to roScreen all over my code, I could draw to an off-screen bitmap ("bgBitmap") and then in my "main" event loop:
<roScreen>.clear(0)
<roScreen>.drawObject(bgBitmap)
<roScreen>.swapBuffers()
yes?
No. I mean, you could do that, but that's overkill. What seems to cause the issue is manipulating non-roScreen memory (creating a bitmap, writing to a bitmap, disposing a bitmap, etc.) after you've initiated the screen update, but before you've called SwapBuffers. You can still draw all of your graphics directly to the roScreen, you just need to make sure they are ready to go before you do so.
"dev42" wrote:
Also, how exactly are references to objects counted ... If I'm in a function and the debugger and it's saying that my <roScreen> object has a refcnt=5 that means I've passed through 5 "nested" functions to get there? or something else?
That, I'm not sure, but I'd bet EnTerr has an idea.
"dev42" wrote:
The follow-up Q is *drum-roll* should I be setting every reference to the <roScreen> to Invalid after I'm done with it? ... and before exiting each function?
I wouldn't think so. You only want to set your roScreen reference to invalid when you're ready to close it.