So, I'm implementing Cocoa and/or OpenGL rendering for #WideGB
Never did graphics programming before, so I have no idea what I'm doing.
I could draw all the 9 tiles in an offscreen framebuffer using #OpenGL, and then apply the filtering shader to the result—but it looks like a lot of pain.
Instead I'm taking the route of composing the 9 tiles bitmaps in software, and then passing the resulting pixel buffer to OpenGL, SDL or Metal.
On the #Cocoa port, I'll probably create one CGImage by tile, and cache them.
On each frame, I can then draw the CGImages on a CGBitmapContext— and pass the buffer to OpenGL or Metal.
I just wonder how to update the CGImages when the underlying buffer changes. Do I need to re-create the image? Or can I update the underlying buffer directly? What about locking or race conditions?
Stay tuned for the next episode of graphics-programming-for-newbies!
Generalistic and moderated instance. All opinions are welcome, but hate speeches are prohibited. Users who don't respect rules will be silenced or suspended, depending on the violation severity.