I fail to understand the rules for updating Draw2D ops. My expectation is that bm.Finish() should update any cached drawing ops. However, when I GetByteArray(), there is nothing there. The following is a minimal working example. I do a Clear(). DrawRect(), Finish(), GetByteArray() and then manually write a value into the red byte. Then I print the byteArray. It's "empty", except the red value.
I display the bitmap and it looks as expected (minus the red pixel, of course). I GetByteArray() again, and now the Draw2D stuff is there! Do I misunderstand bm.Finish()? Or is this a bug?
It would help the readability of your code tremendously if you enclosed it in code tags (click the 3 dots and look for </>).
The first thing that jumps out is that you're creating a single buffered screen and using SwapBuffers which is for double buffered screens.
RenoJim, sorry about just dumping my code into the post. It's my first post with code and I didn't know how to include the example. Thanks for the tip.
I don't think buffering has any relevance to the issue. The example doesn't even need to be displayed. The issue is: draw into a bitmap, finish it, get the byte array, it's empty. It only takes 4 lines of code to reproduce. I just got verbose about it.
My guess it's an issue with caching of draw ops in OpenGL, but what do I know?