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
impl Gl
pub fn init(runtime: &Runtime<'_>) -> Result<Self, String>
pub fn init_from_clear(runtime: &Runtime<'_>, clear: CompatGlClear) -> Self
pub fn context_type(&self) -> HwContextType
pub fn version_info(&self) -> GlVersionInfo
pub fn max_texture_size(&self) -> Option<u32>
pub fn supports_shader_pipeline(&self) -> bool
pub fn supports_textures(&self) -> bool
pub fn supports_blending(&self) -> bool
pub fn supports_vertex_arrays(&self) -> bool
pub fn clear_color(&self, r: f32, g: f32, b: f32, a: f32)
pub fn clear_color_buffer(&self)
pub fn clear_color_depth_buffer(&self)
pub fn viewport(&self, rect: GlRect) -> Result<(), String>
pub fn unbind_framebuffer(&self, target: GlFramebufferTarget)
pub fn bind_framebuffer( &self, target: GlFramebufferTarget, framebuffer: Option<GlFramebuffer>, ) -> Result<(), String>
pub fn check_no_error(&self, operation: &str) -> Result<(), String>
pub fn check_bound_framebuffer_complete( &self, target: GlFramebufferTarget, ) -> Result<(), String>
pub fn enable(&self, capability: GlCapability)
pub fn disable(&self, capability: GlCapability)
pub fn build_program( &self, vertex_shader: &str, fragment_shader: &str, ) -> Result<GlProgram, String>
pub fn compile_shader_source( &self, stage: GlShaderStage, source: &str, ) -> Result<GlShader, String>
pub fn delete_shader(&self, shader: GlShader)
pub fn create_program(&self) -> Result<GlProgram, String>
pub fn link_program(&self, program: GlProgram) -> Result<(), String>
pub fn delete_program(&self, program: GlProgram)
pub fn use_no_program(&self)
pub fn use_program(&self, program: Option<GlProgram>)
pub fn gen_buffer(&self) -> Result<GlBuffer, String>
pub fn unbind_buffer(&self, target: GlBufferTarget)
pub fn bind_buffer(&self, target: GlBufferTarget, buffer: Option<GlBuffer>)
pub fn buffer_data<T>( &self, target: GlBufferTarget, data: &[T], usage: GlBufferUsage, ) -> Result<(), String>
pub fn delete_buffer(&self, buffer: GlBuffer)
pub fn enable_vertex_attrib(&self, location: GlVertexAttribLocation)
pub fn disable_vertex_attrib(&self, location: GlVertexAttribLocation)
pub fn vertex_attrib_pointer_f32( &self, location: GlVertexAttribLocation, layout: GlVertexAttribF32Layout, )
pub fn required_attrib_location( &self, program: GlProgram, name: &str, ) -> Result<GlVertexAttribLocation, String>
pub fn required_uniform_location( &self, program: GlProgram, name: &str, ) -> Result<GlUniformLocation, String>
pub fn uniform_1i(&self, location: GlUniformLocation, value: i32)
pub fn uniform_4fv(&self, location: GlUniformLocation, values: &[f32; 4])
pub fn draw_arrays( &self, mode: GlDrawMode, range: GlDrawRange, ) -> Result<(), String>
pub fn gen_texture(&self) -> Result<GlTexture, String>
pub fn unbind_texture(&self, target: GlTextureTarget)
pub fn bind_texture( &self, target: GlTextureTarget, texture_id: Option<GlTexture>, )
pub fn active_texture(&self, unit: GlTextureUnit) -> Result<(), String>
pub fn tex_min_filter( &self, target: GlTextureTarget, filter: GlTextureMinFilter, )
pub fn tex_mag_filter( &self, target: GlTextureTarget, filter: GlTextureMagFilter, )
pub fn tex_wrap_s(&self, target: GlTextureTarget, wrap: GlTextureWrap)
pub fn tex_wrap_t(&self, target: GlTextureTarget, wrap: GlTextureWrap)
pub fn pixel_store_unpack_alignment(&self, alignment: GlPixelStoreAlignment)
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>
pub fn delete_texture(&self, texture_id: GlTexture)
pub fn blend_func(&self, source: GlBlendFactor, destination: GlBlendFactor)
pub fn gen_vertex_array(&self) -> Result<GlVertexArray, String>
pub fn bind_vertex_array( &self, array: Option<GlVertexArray>, ) -> Result<(), String>
pub fn unbind_vertex_array(&self) -> Result<(), String>
pub fn delete_vertex_array(&self, array: GlVertexArray) -> Result<(), String>
pub fn from_glsym(gl: glsym) -> Self
Trait Implementations§
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more