pub struct Texture2D {}
Implementations
sourceimpl Texture2D
impl Texture2D
sourcepub fn gl_new_from_foreign(
ctx: &Context,
gl_handle: u32,
width: i32,
height: i32,
format: PixelFormat
) -> Texture2D
pub fn gl_new_from_foreign(
ctx: &Context,
gl_handle: u32,
width: i32,
height: i32,
format: PixelFormat
) -> Texture2D
Wraps an existing GL_TEXTURE_2D texture object as a Texture2D
.
This can be used for integrating with software using OpenGL
directly.
The texture is still configurable until it has been allocated so
for example you can declare whether the texture is premultiplied
with Texture::set_premultiplied
.
The results are undefined for passing an invalid gl_handle
or if width
or height
don’t have the correct texture
geometry.
ctx
A Context
gl_handle
A GL handle for a GL_TEXTURE_2D texture object
width
Width of the foreign GL texture
height
Height of the foreign GL texture
format
The format of the texture
Returns
A newly allocated Texture2D
pub fn from_bitmap(bitmap: &Bitmap) -> Texture2D
pub fn from_data(
ctx: &Context,
width: u32,
height: u32,
format: PixelFormat,
rowstride: u32,
data: &[u8]
) -> Texture2D
pub fn from_file(ctx: &Context, filename: &str) -> Texture2D
pub fn with_size(context: &Context, width: u32, height: u32) -> Texture2D
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Texture2D
impl Send for Texture2D
impl Sync for Texture2D
impl Unpin for Texture2D
impl UnwindSafe for Texture2D
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<'a, T, C, M> Inspect<'a, C, &'a C, M> for T
impl<'a, T, C, M> Inspect<'a, C, &'a C, M> for T
impl<'a, T, C, M> Inspect<'a, C, &'a mut C, M> for T
impl<'a, T, C, M> Inspect<'a, C, &'a mut C, M> for T
impl<Fr, To> IntoColor<To> for Fr where
To: FromColor<Fr>,
impl<Fr, To> IntoColor<To> for Fr where
To: FromColor<Fr>,
fn into_color(self) -> To
fn into_color(self) -> To
Convert into color
impl<T> Pointable for T
impl<T> Pointable for T
impl<T> SetParameter for T
impl<T> SetParameter for T
fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
T: Parameter<Self>,
fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
T: Parameter<Self>,
Sets value
as a parameter of self
.