Skip to main content

Gl

Struct Gl 

Source
pub struct Gl { /* private fields */ }
Expand description

Ergonomic OpenGL access for libretro hardware-rendered cores.

Gl::init requires only the minimal symbols needed to submit a legal hardware-rendered frame. Shader, buffer, texture, blending, and richer GL entry points are loaded opportunistically so cores can keep a clear-only diagnostic path alive on frontends with incomplete symbol lookup.

Implementations§

Source§

impl Gl

Source

pub fn init(runtime: &Runtime<'_>) -> Result<Self, String>

Source

pub fn init_from_clear(runtime: &Runtime<'_>, clear: CompatGlClear) -> Self

Source

pub fn context_type(&self) -> HwContextType

Source

pub fn version_info(&self) -> GlVersionInfo

Source

pub fn max_texture_size(&self) -> Option<u32>

Source

pub fn supports_shader_pipeline(&self) -> bool

Source

pub fn supports_textures(&self) -> bool

Source

pub fn supports_blending(&self) -> bool

Source

pub fn supports_vertex_arrays(&self) -> bool

Source

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

Source

pub fn clear_color_buffer(&self)

Source

pub fn clear_color_depth_buffer(&self)

Source

pub fn viewport(&self, rect: GlRect) -> Result<(), String>

Source

pub fn unbind_framebuffer(&self, target: GlFramebufferTarget)

Source

pub fn bind_framebuffer( &self, target: GlFramebufferTarget, framebuffer: Option<GlFramebuffer>, ) -> Result<(), String>

Source

pub fn check_no_error(&self, operation: &str) -> Result<(), String>

Source

pub fn check_bound_framebuffer_complete( &self, target: GlFramebufferTarget, ) -> Result<(), String>

Source

pub fn enable(&self, capability: GlCapability)

Source

pub fn disable(&self, capability: GlCapability)

Source

pub fn build_program( &self, vertex_shader: &str, fragment_shader: &str, ) -> Result<GlProgram, String>

Source

pub fn compile_shader_source( &self, stage: GlShaderStage, source: &str, ) -> Result<GlShader, String>

Source

pub fn delete_shader(&self, shader: GlShader)

Source

pub fn create_program(&self) -> Result<GlProgram, String>

Source

pub fn delete_program(&self, program: GlProgram)

Source

pub fn use_no_program(&self)

Source

pub fn use_program(&self, program: Option<GlProgram>)

Source

pub fn gen_buffer(&self) -> Result<GlBuffer, String>

Source

pub fn unbind_buffer(&self, target: GlBufferTarget)

Source

pub fn bind_buffer(&self, target: GlBufferTarget, buffer: Option<GlBuffer>)

Source

pub fn buffer_data<T>( &self, target: GlBufferTarget, data: &[T], usage: GlBufferUsage, ) -> Result<(), String>

Source

pub fn delete_buffer(&self, buffer: GlBuffer)

Source

pub fn enable_vertex_attrib(&self, location: GlVertexAttribLocation)

Source

pub fn disable_vertex_attrib(&self, location: GlVertexAttribLocation)

Source

pub fn vertex_attrib_pointer_f32( &self, location: GlVertexAttribLocation, layout: GlVertexAttribF32Layout, )

Source

pub fn required_attrib_location( &self, program: GlProgram, name: &str, ) -> Result<GlVertexAttribLocation, String>

Source

pub fn required_uniform_location( &self, program: GlProgram, name: &str, ) -> Result<GlUniformLocation, String>

Source

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

Source

pub fn uniform_4fv(&self, location: GlUniformLocation, values: &[f32; 4])

Source

pub fn draw_arrays( &self, mode: GlDrawMode, range: GlDrawRange, ) -> Result<(), String>

Source

pub fn gen_texture(&self) -> Result<GlTexture, String>

Source

pub fn unbind_texture(&self, target: GlTextureTarget)

Source

pub fn bind_texture( &self, target: GlTextureTarget, texture_id: Option<GlTexture>, )

Source

pub fn active_texture(&self, unit: GlTextureUnit) -> Result<(), String>

Source

pub fn tex_min_filter( &self, target: GlTextureTarget, filter: GlTextureMinFilter, )

Source

pub fn tex_mag_filter( &self, target: GlTextureTarget, filter: GlTextureMagFilter, )

Source

pub fn tex_wrap_s(&self, target: GlTextureTarget, wrap: GlTextureWrap)

Source

pub fn tex_wrap_t(&self, target: GlTextureTarget, wrap: GlTextureWrap)

Source

pub fn pixel_store_unpack_alignment(&self, alignment: GlPixelStoreAlignment)

Source

pub fn tex_image_2d( &self, target: GlTextureTarget, internal_format: GlTextureInternalFormat, level: GlTextureLevel, size: GlTextureSize2D, format: GlTextureFormat, data_type: GlTextureDataType, bytes: Option<&[u8]>, ) -> Result<(), String>

Source

pub fn delete_texture(&self, texture_id: GlTexture)

Source

pub fn blend_func(&self, source: GlBlendFactor, destination: GlBlendFactor)

Source

pub fn gen_vertex_array(&self) -> Result<GlVertexArray, String>

Source

pub fn bind_vertex_array( &self, array: Option<GlVertexArray>, ) -> Result<(), String>

Source

pub fn unbind_vertex_array(&self) -> Result<(), String>

Source

pub fn delete_vertex_array(&self, array: GlVertexArray) -> Result<(), String>

Source

pub fn from_glsym(gl: glsym) -> Self

Trait Implementations§

Source§

impl Clone for Gl

Source§

fn clone(&self) -> Gl

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

§

impl Freeze for Gl

§

impl RefUnwindSafe for Gl

§

impl Send for Gl

§

impl Sync for Gl

§

impl Unpin for Gl

§

impl UnsafeUnpin for Gl

§

impl UnwindSafe for Gl

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.