Struct GLContext

Source
pub struct GLContext {
    pub reference: Reference,
}

Fields§

§reference: Reference

Implementations§

Source§

impl GLContext

Source

pub fn create_buffer(&self) -> WebGLBuffer

Source

pub fn bind_buffer(&self, kind: BufferKind, buffer: &WebGLBuffer)

Source

pub fn buffer_data(&self, kind: BufferKind, data: &[u8], draw: DrawMode)

Source

pub fn unbind_buffer(&self, kind: BufferKind)

Source

pub fn create_shader(&self, kind: ShaderKind) -> WebGLShader

Source

pub fn shader_source(&self, shader: &WebGLShader, source: &str)

Source

pub fn compile_shader(&self, shader: &WebGLShader)

Source

pub fn create_program(&self) -> WebGLProgram

Source

pub fn use_program(&self, program: &WebGLProgram)

Source

pub fn attach_shader(&self, program: &WebGLProgram, shader: &WebGLShader)

Source

pub fn get_attrib_location( &self, program: &WebGLProgram, name: &str, ) -> Option<u32>

Source

pub fn get_uniform_location( &self, program: &WebGLProgram, name: &str, ) -> Option<WebGLUniformLocation>

Source

pub fn vertex_attrib_pointer( &self, location: u32, size: AttributeSize, kind: DataType, normalized: bool, stride: u32, offset: u32, )

Source

pub fn enable_vertex_attrib_array(&self, location: u32)

Source

pub fn clear_color(&self, r: f32, g: f32, b: f32, a: f32)

Source

pub fn enable(&self, flag: Flag)

Source

pub fn clear(&self, bit: BufferBit)

Source

pub fn viewport(&self, x: i32, y: i32, width: u32, height: u32)

Source

pub fn draw_elements( &self, mode: Primitives, count: usize, kind: DataType, offset: u32, )

Source

pub fn draw_arrays(&self, mode: Primitives, count: usize)

Source

pub fn pixel_storei(&self, storage: PixelStorageMode, value: i32)

Source

pub fn tex_image2d( &self, target: TextureBindPoint, level: u8, width: u16, height: u16, format: PixelFormat, kind: DataType, pixels: &[u8], )

Source

pub fn tex_sub_image2d( &self, target: TextureBindPoint, level: u8, xoffset: u16, yoffset: u16, width: u16, height: u16, format: PixelFormat, kind: DataType, pixels: &[u8], )

Source

pub fn compressed_tex_image2d( &self, target: TextureBindPoint, level: u8, compression: TextureCompression, width: u16, height: u16, data: &[u8], )

Source

pub fn get_program_parameter( &self, program: &WebGLProgram, pname: ShaderParameter, ) -> i32

Source

pub fn get_active_uniform( &self, program: &WebGLProgram, location: u32, ) -> WebGLActiveInfo

Source

pub fn get_active_attrib( &self, program: &WebGLProgram, location: u32, ) -> WebGLActiveInfo

Source

pub fn create_texture(&self) -> WebGLTexture

Source

pub fn delete_texture(&self, texture: &WebGLTexture)

Source

pub fn bind_texture(&self, texture: &WebGLTexture)

Source

pub fn unbind_texture(&self)

Source

pub fn blend_func(&self, b1: BlendMode, b2: BlendMode)

Source

pub fn uniform_matrix_4fv( &self, location: WebGLUniformLocation, value: &[[f32; 4]; 4], )

Source

pub fn uniform_matrix_3fv( &self, location: WebGLUniformLocation, value: &[[f32; 3]; 3], )

Source

pub fn uniform_matrix_2fv( &self, location: WebGLUniformLocation, value: &[[f32; 2]; 2], )

Source

pub fn uniform_1i(&self, location: WebGLUniformLocation, value: i32)

Source

pub fn uniform_1f(&self, location: WebGLUniformLocation, value: f32)

Source

pub fn uniform_4f( &self, location: WebGLUniformLocation, value: (f32, f32, f32, f32), )

Source

pub fn tex_parameteri(&self, pname: TextureParameter, param: i32)

Source

pub fn tex_parameterfv(&self, pname: TextureParameter, param: f32)

Source

pub fn create_vertex_array(&self) -> WebGLVertexArray

Source

pub fn bind_vertex_array(&self, vao: WebGLVertexArray)

Source

pub fn unbind_vertex_array(&self)

Trait Implementations§

Source§

impl AsReference for GLContext

Source§

impl Debug for GLContext

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for GLContext

Source§

fn eq(&self, other: &GLContext) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for GLContext

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.