pub struct GLContext {
pub reference: Reference,
}
Fields
reference: Reference
Implementations
sourceimpl GLContext
impl GLContext
pub fn new<F>(loadfn: F) -> GLContextwhere
F: FnMut(&str) -> *const c_void,
pub fn active_texture(&self, texture: GLenum)
pub fn attach_shader(&self, program: &WebGLProgram, shader: &WebGLShader)
pub fn bind_attrib_location(program: &WebGLProgram, index: GLuint, name: &str)
pub fn bind_buffer(&self, target: GLenum, buffer: &WebGLBuffer)
pub fn bind_vertex_array(&self, vao: Option<&WebGLVertexArray>)
pub fn bind_framebuffer(target: GLenum, framebuffer: GLuint)
pub fn bind_texture(&self, target: GLenum, texture: &WebGLTexture)
pub fn blend_color(
&self,
red: GLfloat,
green: GLfloat,
blue: GLfloat,
alpha: GLfloat
)
pub fn blend_equation(&self, mode: GLenum)
pub fn blend_equation_separate(&self, mode_rgb: GLenum, mode_alpha: GLenum)
pub fn blend_func(&self, sfactor: GLenum, dfactor: GLenum)
pub fn blend_func_separate(
&self,
sfactor_rgb: GLenum,
dfactor_rgb: GLenum,
sfactor_alpha: GLenum,
dfactor_alpha: GLenum
)
pub fn buffer_data<T>(&self, target: GLenum, data: &[T], usage: GLenum)
pub fn buffer_sub_data<T>(&self, target: GLenum, offset: GLuint, data: &[T])
pub fn clear(&self, bit: GLbitfield)
pub fn clear_color(&self, r: GLfloat, g: GLfloat, b: GLfloat, a: GLfloat)
pub fn clear_depth(&self, value: GLfloat)
pub fn clear_stencil(&self, value: GLint)
pub fn color_mask(
red: GLboolean,
green: GLboolean,
blue: GLboolean,
alpha: GLboolean
)
pub fn compile_shader(&self, shader: &WebGLShader)
pub fn create_buffer(&self) -> Option<WebGLBuffer>
pub fn create_shader(&self, target: GLenum) -> Option<WebGLShader>
pub fn create_program(&self) -> Option<WebGLProgram>
pub fn create_sampler(&self) -> Option<WebGLSampler>
pub fn create_texture(&self) -> Option<WebGLTexture>
pub fn create_vertex_array(&self) -> Option<WebGLVertexArray>
pub fn cull_face(&self, mode: GLenum)
pub fn compressed_tex_image2d(
&self,
target: GLenum,
level: u8,
compression: GLenum,
width: u16,
height: u16,
data: &[u8]
)
pub fn delete_buffer(&self, buffer: &WebGLBuffer)
pub fn delete_framebuffer(&self, fbo: GLuint)
pub fn delete_program(&self, program: Option<&WebGLProgram>)
pub fn delete_shader(&self, shader: &WebGLShader)
pub fn delete_texture(&self, texture: &WebGLTexture)
pub fn depth_func(&self, func: GLenum)
pub fn depth_mask(&self, flag: GLboolean)
pub fn depth_rangef(&self, n: GLfloat, f: GLfloat)
pub fn detach_shader(&self, program: &WebGLProgram, shader: &WebGLShader)
pub fn disable(&self, flag: GLenum)
pub fn draw_elements(
&self,
mode: GLenum,
count: GLsizei,
kind: GLenum,
offset: GLuint
)
pub fn draw_arrays(&self, mode: GLenum, count: GLsizei)
pub fn framebuffer_texture2_d(
&self,
target: GLenum,
attachment: GLenum,
textarget: GLenum,
texture: Option<&WebGLTexture>,
level: GLint
)
pub fn front_face(&self, mode: GLenum)
pub fn shader_source(&self, shader: &WebGLShader, source: &str)
pub fn line_width(&self, width: GLfloat)
pub fn link_program(&self, program: &WebGLProgram)
pub fn validate_program(&self, program: &WebGLProgram)
pub fn use_program(&self, program: &WebGLProgram)
pub fn get_program_parameter(
&self,
program: &WebGLProgram,
pname: GLenum
) -> GLint
pub fn get_program_info_log(&self, program: &WebGLProgram) -> Option<String>
pub fn get_active_uniform(
&self,
program: Option<&WebGLProgram>,
location: GLuint
) -> WebGLActiveInfo
pub fn get_active_attrib(
&self,
program: Option<&WebGLProgram>,
location: GLuint
) -> WebGLActiveInfo
pub fn get_attrib_location(&self, program: &WebGLProgram, name: &str) -> i32
pub fn get_uniform_location(
&self,
program: &WebGLProgram,
name: &str
) -> Option<WebGLUniformLocation>
pub fn get_shader_parameter(&self, shader: &WebGLShader, pname: GLenum) -> GLint
pub fn get_shader_info_log(&self, shader: &WebGLShader) -> Option<String>
pub fn vertex_attrib_pointer(
&self,
location: GLuint,
size: GLint,
kind: GLenum,
normalized: GLboolean,
stride: GLsizei,
offset: GLintptr
)
pub fn enable(&self, flag: GLenum)
pub fn enable_vertex_attrib_array(&self, location: GLuint)
pub fn viewport(&self, x: GLint, y: GLint, width: GLint, height: GLint)
pub fn pixel_storei(&self, storage: GLenum, value: GLint)
pub fn polygon_mode(&self, face: GLenum, mode: GLenum)
pub fn tex_image2d(
&self,
target: GLenum,
level: GLint,
internalformat: GLenum,
width: GLsizei,
height: GLsizei,
border: GLint,
format: GLenum,
kind: GLenum,
pixels: &[u8]
)
pub fn tex_sub_image2d(
&self,
target: GLenum,
level: GLint,
xoffset: GLsizei,
yoffset: GLsizei,
width: GLsizei,
height: GLsizei,
format: GLenum,
kind: GLenum,
pixels: &[u8]
)
pub fn uniform_matrix4fv(
&self,
location: Option<&WebGLUniformLocation>,
transpose: GLboolean,
value: &[f32]
)
pub fn uniform_matrix4fv_1(
&self,
location: Option<&WebGLUniformLocation>,
transpose: GLboolean,
value: *const GLfloat
)
pub fn uniform_matrix3fv(
&self,
location: Option<&WebGLUniformLocation>,
transpose: GLboolean,
value: &[f32]
)
pub fn uniform_matrix3fv_1(
&self,
location: Option<&WebGLUniformLocation>,
transpose: GLboolean,
value: *const GLfloat
)
pub fn uniform_matrix2fv(
&self,
location: Option<&WebGLUniformLocation>,
transpose: GLboolean,
value: &[f32]
)
pub fn uniform_matrix2fv_1(
&self,
location: Option<&WebGLUniformLocation>,
transpose: GLboolean,
value: *const GLfloat
)
pub fn uniform1ui(&self, location: Option<&WebGLUniformLocation>, value: u32)
pub fn uniform2ui(&self, location: Option<&WebGLUniformLocation>, x: u32, y: u32)
pub fn uniform3ui(
&self,
location: Option<&WebGLUniformLocation>,
x: u32,
y: u32,
z: u32
)
pub fn uniform4ui(
&self,
location: Option<&WebGLUniformLocation>,
x: u32,
y: u32,
z: u32,
w: u32
)
pub fn uniform1i(&self, location: Option<&WebGLUniformLocation>, x: i32)
pub fn uniform2i(&self, location: Option<&WebGLUniformLocation>, x: i32, y: i32)
pub fn uniform3i(
&self,
location: Option<&WebGLUniformLocation>,
x: i32,
y: i32,
z: i32
)
pub fn uniform4i(
&self,
location: Option<&WebGLUniformLocation>,
x: i32,
y: i32,
z: i32,
w: i32
)
pub fn uniform2iv(
&self,
location: Option<&WebGLUniformLocation>,
value: (i32, i32)
)
pub fn uniform3iv(
&self,
location: Option<&WebGLUniformLocation>,
value: (i32, i32, i32)
)
pub fn uniform4iv(
&self,
location: Option<&WebGLUniformLocation>,
value: (i32, i32, i32, i32)
)
pub fn uniform1f(&self, location: Option<&WebGLUniformLocation>, value: f32)
pub fn uniform2f(&self, location: Option<&WebGLUniformLocation>, x: f32, y: f32)
pub fn uniform2fv(
&self,
location: Option<&WebGLUniformLocation>,
value: (f32, f32)
)
pub fn uniform3f(
&self,
location: Option<&WebGLUniformLocation>,
x: f32,
y: f32,
z: f32
)
pub fn uniform3fv(
&self,
location: Option<&WebGLUniformLocation>,
value: (f32, f32, f32)
)
pub fn uniform4f(
&self,
location: Option<&WebGLUniformLocation>,
x: f32,
y: f32,
z: f32,
w: f32
)
pub fn uniform4fv(
&self,
location: Option<&WebGLUniformLocation>,
value: (f32, f32, f32, f32)
)
pub fn tex_parameteri(&self, target: GLenum, pname: GLenum, param: i32)
pub fn tex_parameterfv(&self, target: GLenum, pname: GLenum, param: f32)
pub fn create_framebuffer(&self) -> Option<WebGLFramebuffer>
pub fn draw_buffers(&self, buffers: &[GLenum])
pub fn create_renderbuffer(&self) -> Option<WebGLRenderbuffer>
pub fn bind_renderbuffer(
&self,
target: GLenum,
renderbuffer: Option<&WebGLRenderbuffer>
)
pub fn renderbuffer_storage(
&self,
target: GLenum,
internalformat: GLenum,
width: GLsizei,
height: GLsizei
)
pub fn framebuffer_renderbuffer(
&self,
target: GLenum,
attachment: GLenum,
renderbuffertarget: GLenum,
renderbuffer: Option<&WebGLRenderbuffer>
)
Trait Implementations
sourceimpl AsReference for GLContext
impl AsReference for GLContext
fn as_reference(&self) -> &Reference
impl Copy for GLContext
impl Eq for GLContext
impl StructuralEq for GLContext
impl StructuralPartialEq for GLContext
Auto Trait Implementations
impl RefUnwindSafe for GLContext
impl Send for GLContext
impl Sync for GLContext
impl Unpin for GLContext
impl UnwindSafe for GLContext
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
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<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>>::Resultwhere
T: Parameter<Self>,
fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Resultwhere
T: Parameter<Self>,
Sets
value
as a parameter of self
.