Created
November 1, 2014 01:05
-
-
Save bvssvni/63ed1bbb05bc7834604d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// Calls closure with a texture constructor enabled. | |
/// This is required to render characters. | |
pub fn with_texture_constructor<'a>(&mut self, texture_constructor: TextureConstructor<'a, T>, f: |&mut UiContext<T>|) { | |
use std::mem::transmute; | |
self.glyph_cache.texture_constructor = | |
Some(unsafe { transmute(texture_constructor) }); | |
f(self); | |
self.glyph_cache.texture_constructor = None; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment