pub struct GLContext {
pub reference: Reference,
}
Fields§
§reference: Reference
Implementations§
Source§impl GLContext
impl GLContext
pub fn create_buffer(&self) -> WebGLBuffer
pub fn bind_buffer(&self, kind: BufferKind, buffer: &WebGLBuffer)
pub fn buffer_data(&self, kind: BufferKind, data: &[u8], draw: DrawMode)
pub fn unbind_buffer(&self, kind: BufferKind)
pub fn create_shader(&self, kind: ShaderKind) -> WebGLShader
pub fn shader_source(&self, shader: &WebGLShader, source: &str)
pub fn compile_shader(&self, shader: &WebGLShader)
pub fn create_program(&self) -> WebGLProgram
pub fn link_program(&self, program: &WebGLProgram)
pub fn use_program(&self, program: &WebGLProgram)
pub fn attach_shader(&self, program: &WebGLProgram, shader: &WebGLShader)
pub fn get_attrib_location( &self, program: &WebGLProgram, name: &str, ) -> Option<u32>
pub fn get_uniform_location( &self, program: &WebGLProgram, name: &str, ) -> Option<WebGLUniformLocation>
pub fn vertex_attrib_pointer( &self, location: u32, size: AttributeSize, kind: DataType, normalized: bool, stride: u32, offset: u32, )
pub fn enable_vertex_attrib_array(&self, location: u32)
pub fn clear_color(&self, r: f32, g: f32, b: f32, a: f32)
pub fn enable(&self, flag: Flag)
pub fn clear(&self, bit: BufferBit)
pub fn viewport(&self, x: i32, y: i32, width: u32, height: u32)
pub fn draw_elements( &self, mode: Primitives, count: usize, kind: DataType, offset: u32, )
pub fn draw_arrays(&self, mode: Primitives, count: usize)
pub fn pixel_storei(&self, storage: PixelStorageMode, value: i32)
pub fn tex_image2d( &self, target: TextureBindPoint, level: u8, width: u16, height: u16, format: PixelFormat, kind: DataType, pixels: &[u8], )
pub fn tex_sub_image2d( &self, target: TextureBindPoint, level: u8, xoffset: u16, yoffset: u16, width: u16, height: u16, format: PixelFormat, kind: DataType, pixels: &[u8], )
pub fn compressed_tex_image2d( &self, target: TextureBindPoint, level: u8, compression: TextureCompression, width: u16, height: u16, data: &[u8], )
pub fn get_program_parameter( &self, program: &WebGLProgram, pname: ShaderParameter, ) -> i32
pub fn get_active_uniform( &self, program: &WebGLProgram, location: u32, ) -> WebGLActiveInfo
pub fn get_active_attrib( &self, program: &WebGLProgram, location: u32, ) -> WebGLActiveInfo
Sourcepub fn create_texture(&self) -> WebGLTexture
pub fn create_texture(&self) -> WebGLTexture
pub fn delete_texture(&self, texture: &WebGLTexture)
pub fn bind_texture(&self, texture: &WebGLTexture)
pub fn unbind_texture(&self)
pub fn blend_func(&self, b1: BlendMode, b2: BlendMode)
pub fn uniform_matrix_4fv( &self, location: WebGLUniformLocation, value: &[[f32; 4]; 4], )
pub fn uniform_matrix_3fv( &self, location: WebGLUniformLocation, value: &[[f32; 3]; 3], )
pub fn uniform_matrix_2fv( &self, location: WebGLUniformLocation, value: &[[f32; 2]; 2], )
pub fn uniform_1i(&self, location: WebGLUniformLocation, value: i32)
pub fn uniform_1f(&self, location: WebGLUniformLocation, value: f32)
pub fn uniform_4f( &self, location: WebGLUniformLocation, value: (f32, f32, f32, f32), )
pub fn tex_parameteri(&self, pname: TextureParameter, param: i32)
pub fn tex_parameterfv(&self, pname: TextureParameter, param: f32)
pub fn create_vertex_array(&self) -> WebGLVertexArray
pub fn bind_vertex_array(&self, vao: WebGLVertexArray)
pub fn unbind_vertex_array(&self)
Trait Implementations§
Source§impl AsReference for GLContext
impl AsReference for GLContext
fn as_reference(&self) -> &Reference
impl StructuralPartialEq for GLContext
Auto Trait Implementations§
impl Freeze for GLContext
impl RefUnwindSafe for GLContext
impl Send for GLContext
impl Sync for GLContext
impl Unpin for GLContext
impl UnwindSafe for GLContext
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