[][src]Struct azul_core::gl::GlShader

pub struct GlShader {
    pub program_id: GLuint,
    pub gl_context: Rc<dyn Gl>,
}

Fields

program_id: GLuintgl_context: Rc<dyn Gl>

Implementations

impl GlShader[src]

pub fn new(
    gl_context: Rc<dyn Gl>,
    vertex_shader: &str,
    fragment_shader: &str
) -> Result<Self, GlShaderCreateError>
[src]

Compiles and creates a new OpenGL shader, created from a vertex and a fragment shader string.

If the shader fails to compile, the shader object gets automatically deleted, no cleanup necessary.

pub fn draw<T: VertexLayoutDescription>(
    &mut self,
    buffers: &[(Rc<VertexBuffer<T>>, Vec<Uniform>)],
    clear_color: Option<ColorU>,
    texture_size: LogicalSize
) -> Texture
[src]

Draws vertex buffers, index buffers + uniforms to the currently bound framebuffer

NOTE: FrameBuffer::bind() and VertexBuffer::bind() have to be called first!

Trait Implementations

impl Debug for GlShader[src]

impl Display for GlShader[src]

impl Drop for GlShader[src]

impl Eq for GlShader[src]

impl Hash for GlShader[src]

impl Ord for GlShader[src]

impl PartialEq<GlShader> for GlShader[src]

impl PartialOrd<GlShader> for GlShader[src]

Auto Trait Implementations

impl !RefUnwindSafe for GlShader

impl !Send for GlShader

impl !Sync for GlShader

impl Unpin for GlShader

impl !UnwindSafe for GlShader

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.