Skip to content

Texture update requiring encoder flush not obvious #291

@werner291

Description

@werner291

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions