pub struct GLContext {
    pub reference: u32,
    pub is_webgl2: bool,
}
Expand description

uni-gl internal OpenGL context.

You shouldn’t use this struct directly. Instead, call the methods on WebGLRenderingContext as it automatically dereferences into a GLContext.

This doc is not intended to cover all OpenGL API in depth. Check https://www.khronos.org/opengl/ for more information.

Fields

reference: u32

openGL internal reference

is_webgl2: bool

whether this context is a WebGL 2.0 context

Implementations

create a new OpenGL buffer

delete an existing buffer

bind a buffer to current state.

fills a buffer with data.

kind : see GLContext::bind_buffer.

update a subset of a buffer

kind : see GLContext::bind_buffer.

offset : offset in the buffer where data replacement will begin

this buffer is not bound to the current state anymore.

create a new shader.

set or replace the source code in a shader

compile a shader

create a program

link a program

bind a program to the current state.

attach a shader to a program. A program must have two shaders : vertex and fragment shader.

associate a generic vertex attribute index with a named attribute

return the location of an attribute variable

return the location of a uniform variable

define an array of generic vertex attribute data

enable a generic vertex attribute array

specify clear values for the color buffers

enable GL capabilities.

flag should be one of Flag

disable GL capabilities.

flag should be one of Flag

specify whether front- or back-facing polygons can be culled

enable or disable writing into the depth buffer

specify the value used for depth buffer comparisons

specify the clear value for the depth buffer

clear buffers to preset values

set the viewport

render primitives from indexed array data

render primitives from array data

read a block of pixels from the frame buffer

set pixel storage modes

specify a two-dimensional texture image

update a part of a two-dimensional texture subimage

specify a two-dimensional texture image in a compressed format

return informations about current program

create a new texture object

destroy a texture object

generate mipmaps for current 2D texture

generate mipmaps for current cube map texture

select active texture unit

bind a named 2D texture to a texturing target

current 2D texture is not bound to current state anymore

bind a named cube map texture to a texturing target

current cube map texture is not bound to current state anymore

set the RGB alpha blend equation

specify pixel arithmetic for RGB and alpha components separately

set the blend color

specify the value of a mat4 uniform variable for the current program object

specify the value of a mat3 uniform variable for the current program object

specify the value of a mat2 uniform variable for the current program object

specify the value of an int uniform variable for the current program object

specify the value of a float uniform variable for the current program object

specify the value of a vec2 uniform variable for the current program object

specify the value of a vec3 uniform variable for the current program object

specify the value of a vec4 uniform variable for the current program object

set texture integer parameters

set texture float parameters

create a vertex array object

destroy a vertex array object

bind a vertex array object to current state

current vertex array object is not bound to the current state anymore

specify which color buffers are to be drawn into

create a new framebuffer

destroy a framebuffer

bind a framebuffer to the current state

attach a texture to a framebuffer

unbind a framebuffer

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.