piston_window icon indicating copy to clipboard operation
piston_window copied to clipboard

How to update `G2dTexture` during a `draw_2d` event?

Open mitchmindtree opened this issue 9 years ago • 1 comments

I'd like to use a G2dTexture as a cache for some glyphs alongside a rusttype::gpu_cache::Cache. In order to call UpdateTexture::update, it looks like mutable access to the Encoder is required, however it is already uniquely borrowed by the GfxGraphics instance during the call to draw_2d. Perhaps we should make the Encoder field on the GfxGraphics public?

Edit: Also, the update method requires the Format type, which I think is currently inaccessible through through piston_window. Same goes for the trait itself I think. Perhaps we should re-export the texture crate too?

mitchmindtree avatar Jun 13 '16 11:06 mitchmindtree

Yes, that would be nice.

bvssvni avatar Jun 13 '16 20:06 bvssvni