piston_window
piston_window copied to clipboard
Texture update requiring encoder flush not obvious
Hello,
I was trying to use G2dTexture::update
to attempt to stream an animation to the window, but nothing was happening. Method call returned Ok
, and there were no subequent errors or warnings.
After some time debugging, it turned out that I needed to flush the texture context's encoder (from PistonWindow::create_texture_context
), where the device
parameter is the device
from PistonWindow
.
This is not obvious, especially for a user who does not know about buffers and flushing, and just wants to put pixels on the screen.
Would it be possible to at least document on G2dTexture::update
that the encoder needs to be flushed? Or somehow produce a warning or an error if the user never flushes the buffer? (Though that might be hard without making breaking changes.)