piston_window icon indicating copy to clipboard operation
piston_window copied to clipboard

Texture update requiring encoder flush not obvious

Open werner291 opened this issue 3 years ago • 0 comments

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.)

werner291 avatar Mar 01 '21 10:03 werner291