pub struct Texture {
pub texture_id: i32,
pub image_name: String,
/* private fields */
}Expand description
OpenGL texture. Upon creation, it defines a sampler uniform and initializes a texture buffer, loading it with wit the file’s data. Current supported format(s): png
Fields§
§texture_id: i32§image_name: StringImplementations§
Source§impl Texture
impl Texture
Sourcepub fn new(image_name: &str, options: TextureOptions) -> Texture
pub fn new(image_name: &str, options: TextureOptions) -> Texture
Creates a new texture ready to be loaded It will generate a texture buffer on the gl state machine
Sourcepub fn set_uniform(&self, program: &ShaderProgram)
pub fn set_uniform(&self, program: &ShaderProgram)
Sets the sampler fragment shader Uniform
Trait Implementations§
Source§impl LoadableTexture for Texture
impl LoadableTexture for Texture
fn load_texture(&self)
Auto Trait Implementations§
impl Freeze for Texture
impl RefUnwindSafe for Texture
impl Send for Texture
impl Sync for Texture
impl Unpin for Texture
impl UnsafeUnpin for Texture
impl UnwindSafe for Texture
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more