pub fn initialize(&mut self, width: u32, height: u32, format: TextureFormat) {
        unsafe {
            gl::BindTexture(gl::TEXTURE_2D, self.texture);
            gl::TexImage2D(gl::TEXTURE_2D, 0, // Mipmap level
                           format as GLint, // Internal format
                           width as GLsizei, height as GLsizei, 0, // Size and border
                           format.unsized_format(), // Data format
                           gl::UNSIGNED_BYTE, ptr::null());
        }

        self.width = width;
        self.height = height;
        self.format = format;
    }
/// Converts this texture to a empty texture of the given size. The contents
/// of the texture after this operation are undefined.
Converts this texture to a empty texture of the given size. The contents
of the texture after this operation are undefined.
Converts this texture to a empty texture of the given size . The contents of the texture after this operation are undefined .
pub fn initialize(&mut self, width: u32, height: u32, format: TextureFormat) {
        unsafe {
            gl::BindTexture(gl::TEXTURE_2D, self.texture);
            gl::TexImage2D(gl::TEXTURE_2D, 0, // Mipmap level
                           format as GLint, // Internal format
                           width as GLsizei, height as GLsizei, 0, // Size and border
                           format.unsized_format(), // Data format
                           gl::UNSIGNED_BYTE, ptr::null());
        }
        self.width = width;
        self.height = height;
        self.format = format;
    }
pub fn initialize ( & mut self , width : u32 , height : u32 , format : TextureFormat ) { unsafe { gl :: BindTexture ( gl :: TEXTURE_2D , self . texture ) ; gl :: TexImage2D ( gl :: TEXTURE_2D , 0 , // Mipmap level format as GLint , // Internal format width as GLsizei , height as GLsizei , 0 , // Size and border format . unsized_format ( ) , // Data format gl :: UNSIGNED_BYTE , ptr :: null ( ) ) ; } self . width = width ; self . height = height ; self . format = format ; }
Converts this texture to a empty texture of the given size.
Converts this texture to a empty texture of the given size .
&mut self
width
u32
height
u32
format
TextureFormat
&mut self
width
u32
height
u32
format
TextureFormat