FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    GlInterface

    struct · ferroui-opengl · v0.5.0

    struct GlInterface
    

    GlInterface only includes essential members and members necessary for the framework itself. It is not a general-purpose interface for OpenGL API.

    Use GlInterface::get_proc_address to get GL procedures you need, or integrate it with third-party GL wrappers.

    The members of GlBasicInfoInterface are available on the interface too.

    View source

    Members

    clear_stencil

    fn clear_stencil(self: &Self, s: i32)
    

    Source

    clear_color

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

    Source

    depth_func

    fn depth_func(self: &Self, value: i32)
    

    Source

    depth_mask

    fn depth_mask(self: &Self, value: i32)
    

    Source

    clear

    fn clear(self: &Self, bits: i32)
    

    Source

    viewport

    fn viewport(self: &Self, x: i32, y: i32, width: i32, height: i32)
    

    Source

    flush

    fn flush(self: &Self)
    

    Source

    finish

    fn finish(self: &Self)
    

    Source

    fence_sync

    fn fence_sync(self: &Self, condition: u32, flags: u32) -> isize
    

    Source

    is_fence_sync_available

    fn is_fence_sync_available(self: &Self) -> bool
    

    Whether the context has the entry point behind fence_sync.

    Source

    client_wait_sync

    fn client_wait_sync(self: &Self, sync: isize, flags: u32, timeout: u64) -> u32
    

    Source

    is_client_wait_sync_available

    fn is_client_wait_sync_available(self: &Self) -> bool
    

    Whether the context has the entry point behind client_wait_sync.

    Source

    delete_sync

    fn delete_sync(self: &Self, sync: isize)
    

    Source

    is_delete_sync_available

    fn is_delete_sync_available(self: &Self) -> bool
    

    Whether the context has the entry point behind delete_sync.

    Source

    read_pixels

    unsafe fn read_pixels(self: &Self, x: i32, y: i32, width: i32, height: i32, format: i32, type_: i32, data: *mut c_void)
    

    Safety

    The pointers passed, and the memory OpenGL reads or writes because of this call, must satisfy what the OpenGL specification requires for the entry point.

    Source

    gen_framebuffers

    unsafe fn gen_framebuffers(self: &Self, count: i32, res: *mut i32)
    

    Safety

    The pointers passed, and the memory OpenGL reads or writes because of this call, must satisfy what the OpenGL specification requires for the entry point.

    Source

    delete_framebuffers

    unsafe fn delete_framebuffers(self: &Self, count: i32, framebuffers: *const i32)
    

    Safety

    The pointers passed, and the memory OpenGL reads or writes because of this call, must satisfy what the OpenGL specification requires for the entry point.

    Source

    bind_framebuffer

    fn bind_framebuffer(self: &Self, target: i32, fb: i32)
    

    Source

    check_framebuffer_status

    fn check_framebuffer_status(self: &Self, target: i32) -> i32
    

    Source

    blit_framebuffer

    fn blit_framebuffer(self: &Self, src_x0: i32, src_y0: i32, src_x1: i32, src_y1: i32, dst_x0: i32, dst_y0: i32, dst_x1: i32, dst_y1: i32, mask: i32, filter: i32)
    

    Source

    is_blit_framebuffer_available

    fn is_blit_framebuffer_available(self: &Self) -> bool
    

    Whether the context has the entry point behind blit_framebuffer.

    Source

    gen_renderbuffers

    unsafe fn gen_renderbuffers(self: &Self, count: i32, res: *mut i32)
    

    Safety

    The pointers passed, and the memory OpenGL reads or writes because of this call, must satisfy what the OpenGL specification requires for the entry point.

    Source

    delete_renderbuffers

    unsafe fn delete_renderbuffers(self: &Self, count: i32, renderbuffers: *const i32)
    

    Safety

    The pointers passed, and the memory OpenGL reads or writes because of this call, must satisfy what the OpenGL specification requires for the entry point.

    Source

    bind_renderbuffer

    fn bind_renderbuffer(self: &Self, target: i32, fb: i32)
    

    Source

    renderbuffer_storage

    fn renderbuffer_storage(self: &Self, target: i32, internal_format: i32, width: i32, height: i32)
    

    Source

    framebuffer_renderbuffer

    fn framebuffer_renderbuffer(self: &Self, target: i32, attachment: i32, renderbuffer_target: i32, renderbuffer: i32)
    

    Source

    gen_textures

    unsafe fn gen_textures(self: &Self, count: i32, res: *mut i32)
    

    Safety

    The pointers passed, and the memory OpenGL reads or writes because of this call, must satisfy what the OpenGL specification requires for the entry point.

    Source

    bind_texture

    fn bind_texture(self: &Self, target: i32, fb: i32)
    

    Source

    active_texture

    fn active_texture(self: &Self, texture: i32)
    

    Source

    delete_textures

    unsafe fn delete_textures(self: &Self, count: i32, textures: *const i32)
    

    Safety

    The pointers passed, and the memory OpenGL reads or writes because of this call, must satisfy what the OpenGL specification requires for the entry point.

    Source

    tex_image_2d

    unsafe fn tex_image_2d(self: &Self, target: i32, level: i32, internal_format: i32, width: i32, height: i32, border: i32, format: i32, type_: i32, data: *const c_void)
    

    Safety

    The pointers passed, and the memory OpenGL reads or writes because of this call, must satisfy what the OpenGL specification requires for the entry point.

    Source

    copy_tex_sub_image_2d

    fn copy_tex_sub_image_2d(self: &Self, target: i32, level: i32, xoffset: i32, yoffset: i32, x: i32, y: i32, width: i32, height: i32)
    

    Source

    tex_parameteri

    fn tex_parameteri(self: &Self, target: i32, name: i32, value: i32)
    

    Source

    tex_sub_image_2d

    unsafe fn tex_sub_image_2d(self: &Self, target: i32, level: i32, xoffset: i32, yoffset: i32, width: i32, height: i32, format: i32, type_: i32, data: *const c_void)
    

    Not from the reference: the upload of a part of a texture, for a render backend that presents frames it draws in memory through the context (the Vello backend, docs/porting/vello-backend.md, section 14).

    Safety

    The pointers passed, and the memory OpenGL reads or writes because of this call, must satisfy what the OpenGL specification requires for the entry point.

    Source

    is_tex_sub_image_2d_available

    fn is_tex_sub_image_2d_available(self: &Self) -> bool
    

    Whether the context has the entry point behind tex_sub_image_2d.

    Source

    pixel_storei

    fn pixel_storei(self: &Self, name: i32, value: i32)
    

    Not from the reference, with tex_sub_image_2d.

    Source

    is_pixel_storei_available

    fn is_pixel_storei_available(self: &Self) -> bool
    

    Whether the context has the entry point behind pixel_storei.

    Source

    framebuffer_texture_2d

    fn framebuffer_texture_2d(self: &Self, target: i32, attachment: i32, tex_target: i32, texture: i32, level: i32)
    

    Source

    create_shader

    fn create_shader(self: &Self, shader_type: i32) -> i32
    

    Source

    shader_source

    unsafe fn shader_source(self: &Self, shader: i32, count: i32, strings: *const *const c_char, lengths: *const i32)
    

    Safety

    The pointers passed, and the memory OpenGL reads or writes because of this call, must satisfy what the OpenGL specification requires for the entry point.

    Source

    compile_shader

    fn compile_shader(self: &Self, shader: i32)
    

    Source

    get_shaderiv

    unsafe fn get_shaderiv(self: &Self, shader: i32, name: i32, parameters: *mut i32)
    

    Safety

    The pointers passed, and the memory OpenGL reads or writes because of this call, must satisfy what the OpenGL specification requires for the entry point.

    Source

    get_shader_info_log

    unsafe fn get_shader_info_log(self: &Self, shader: i32, max_length: i32, length: *mut i32, info_log: *mut c_void)
    

    Safety

    The pointers passed, and the memory OpenGL reads or writes because of this call, must satisfy what the OpenGL specification requires for the entry point.

    Source

    create_program

    fn create_program(self: &Self) -> i32
    

    Source

    attach_shader

    fn attach_shader(self: &Self, program: i32, shader: i32)
    

    Source

    fn link_program(self: &Self, program: i32)
    

    Source

    get_programiv

    unsafe fn get_programiv(self: &Self, program: i32, name: i32, parameters: *mut i32)
    

    Safety

    The pointers passed, and the memory OpenGL reads or writes because of this call, must satisfy what the OpenGL specification requires for the entry point.

    Source

    get_program_info_log

    unsafe fn get_program_info_log(self: &Self, program: i32, max_length: i32, len: *mut i32, info_log: *mut c_void)
    

    Safety

    The pointers passed, and the memory OpenGL reads or writes because of this call, must satisfy what the OpenGL specification requires for the entry point.

    Source

    bind_attrib_location

    unsafe fn bind_attrib_location(self: &Self, program: i32, index: i32, name: *const c_char)
    

    Safety

    The pointers passed, and the memory OpenGL reads or writes because of this call, must satisfy what the OpenGL specification requires for the entry point.

    Source

    gen_buffers

    unsafe fn gen_buffers(self: &Self, len: i32, rv: *mut i32)
    

    Safety

    The pointers passed, and the memory OpenGL reads or writes because of this call, must satisfy what the OpenGL specification requires for the entry point.

    Source

    bind_buffer

    fn bind_buffer(self: &Self, target: i32, buffer: i32)
    

    Source

    buffer_data

    unsafe fn buffer_data(self: &Self, target: i32, size: isize, data: *const c_void, usage: i32)
    

    Safety

    The pointers passed, and the memory OpenGL reads or writes because of this call, must satisfy what the OpenGL specification requires for the entry point.

    Source

    get_attrib_location

    unsafe fn get_attrib_location(self: &Self, program: i32, name: *const c_char) -> i32
    

    Safety

    The pointers passed, and the memory OpenGL reads or writes because of this call, must satisfy what the OpenGL specification requires for the entry point.

    Source

    vertex_attrib_pointer

    unsafe fn vertex_attrib_pointer(self: &Self, index: i32, size: i32, type_: i32, normalized: i32, stride: i32, pointer: *const c_void)
    

    Safety

    The pointers passed, and the memory OpenGL reads or writes because of this call, must satisfy what the OpenGL specification requires for the entry point.

    Source

    enable_vertex_attrib_array

    fn enable_vertex_attrib_array(self: &Self, index: i32)
    

    Source

    use_program

    fn use_program(self: &Self, program: i32)
    

    Source

    draw_arrays

    unsafe fn draw_arrays(self: &Self, mode: i32, first: i32, count: i32)
    

    Safety

    The pointers passed, and the memory OpenGL reads or writes because of this call, must satisfy what the OpenGL specification requires for the entry point.

    Source

    draw_elements

    unsafe fn draw_elements(self: &Self, mode: i32, count: i32, type_: i32, indices: *const c_void)
    

    Safety

    The pointers passed, and the memory OpenGL reads or writes because of this call, must satisfy what the OpenGL specification requires for the entry point.

    Source

    get_uniform_location

    unsafe fn get_uniform_location(self: &Self, program: i32, name: *const c_char) -> i32
    

    Safety

    The pointers passed, and the memory OpenGL reads or writes because of this call, must satisfy what the OpenGL specification requires for the entry point.

    Source

    uniform1f

    fn uniform1f(self: &Self, location: i32, falue: f32)
    

    Source

    uniform1i

    fn uniform1i(self: &Self, location: i32, value: i32)
    

    Source

    uniform_matrix4fv

    unsafe fn uniform_matrix4fv(self: &Self, location: i32, count: i32, transpose: u8, value: *const c_void)
    

    transpose is a GLboolean: 0 or 1.

    Safety

    The pointers passed, and the memory OpenGL reads or writes because of this call, must satisfy what the OpenGL specification requires for the entry point.

    Source

    enable

    fn enable(self: &Self, what: i32)
    

    Source

    disable

    fn disable(self: &Self, what: i32)
    

    Source

    delete_buffers

    unsafe fn delete_buffers(self: &Self, count: i32, buffers: *const i32)
    

    Safety

    The pointers passed, and the memory OpenGL reads or writes because of this call, must satisfy what the OpenGL specification requires for the entry point.

    Source

    delete_program

    fn delete_program(self: &Self, program: i32)
    

    Source

    delete_shader

    fn delete_shader(self: &Self, shader: i32)
    

    Source

    get_renderbuffer_parameteriv_native

    unsafe fn get_renderbuffer_parameteriv_native(self: &Self, target: i32, name: i32, value: *mut i32)
    

    Safety

    The pointers passed, and the memory OpenGL reads or writes because of this call, must satisfy what the OpenGL specification requires for the entry point.

    Source

    delete_vertex_arrays

    unsafe fn delete_vertex_arrays(self: &Self, count: i32, arrays: *const i32)
    

    Safety

    The pointers passed, and the memory OpenGL reads or writes because of this call, must satisfy what the OpenGL specification requires for the entry point.

    Source

    is_delete_vertex_arrays_available

    fn is_delete_vertex_arrays_available(self: &Self) -> bool
    

    Whether the context has the entry point behind delete_vertex_arrays.

    Source

    bind_vertex_array

    fn bind_vertex_array(self: &Self, array: i32)
    

    Source

    is_bind_vertex_array_available

    fn is_bind_vertex_array_available(self: &Self) -> bool
    

    Whether the context has the entry point behind bind_vertex_array.

    Source

    gen_vertex_arrays

    unsafe fn gen_vertex_arrays(self: &Self, n: i32, rv: *mut i32)
    

    Safety

    The pointers passed, and the memory OpenGL reads or writes because of this call, must satisfy what the OpenGL specification requires for the entry point.

    Source

    is_gen_vertex_arrays_available

    fn is_gen_vertex_arrays_available(self: &Self) -> bool
    

    Whether the context has the entry point behind gen_vertex_arrays.

    Source

    read_buffer

    fn read_buffer(self: &Self, buffer: i32)
    

    Source

    is_read_buffer_available

    fn is_read_buffer_available(self: &Self) -> bool
    

    Whether the context has the entry point behind read_buffer.

    Source

    draw_buffer

    fn draw_buffer(self: &Self, buffer: i32)
    

    Source

    is_draw_buffer_available

    fn is_draw_buffer_available(self: &Self) -> bool
    

    Whether the context has the entry point behind draw_buffer.

    Source

    write_buffer

    fn write_buffer(self: &Self, buffer: i32)
    

    Source

    is_write_buffer_available

    fn is_write_buffer_available(self: &Self) -> bool
    

    Whether the context has the entry point behind write_buffer.

    Source

    egl_image_target_texture_2d_oes

    unsafe fn egl_image_target_texture_2d_oes(self: &Self, target: i32, image: *mut c_void)
    

    Safety

    The pointers passed, and the memory OpenGL reads or writes because of this call, must satisfy what the OpenGL specification requires for the entry point.

    Source

    is_egl_image_target_texture_2d_oes_available

    fn is_egl_image_target_texture_2d_oes_available(self: &Self) -> bool
    

    Whether the context has the entry point behind egl_image_target_texture_2d_oes.

    Source

    new

    unsafe fn new(version: GlVersion, get_proc_address: GetProcAddress) -> Self
    

    Resolves the entry points of the current context, which implements version of the API.

    Safety

    get_proc_address must return, for the name of an OpenGL entry point, either null or the address of that entry point in an OpenGL implementation whose calling convention is the platform's default one. The interface must only be used on a thread on which a context of that implementation is current.

    Panics

    Panics when a required entry point cannot be resolved; see GlInterface::try_new.

    Source

    version

    fn version(self: &Self) -> Option<&str>
    

    The GL_VERSION string of the context.

    Source

    vendor

    fn vendor(self: &Self) -> Option<&str>
    

    The GL_VENDOR string of the context.

    Source

    renderer

    fn renderer(self: &Self) -> Option<&str>
    

    The GL_RENDERER string of the context.

    Source

    context_info

    fn context_info(self: &Self) -> &GlContextInfo
    

    The version and the extensions of the context.

    Source

    get_proc_address

    fn get_proc_address(self: &Self, proc: &str) -> *const c_void
    

    Returns an OpenGL function by name.

    The result is the address of the function, which can be cast to a function pointer of its signature; null when the context does not have the function.

    Source

    clear_depth

    fn clear_depth(self: &Self, value: f32)
    

    glClearDepth or, where only that exists, glClearDepthf.

    Source

    gen_framebuffer

    fn gen_framebuffer(self: &Self) -> i32
    

    Creates one framebuffer object.

    Source

    delete_framebuffer

    fn delete_framebuffer(self: &Self, fb: i32)
    

    Deletes one framebuffer object.

    Source

    gen_renderbuffer

    fn gen_renderbuffer(self: &Self) -> i32
    

    Creates one renderbuffer object.

    Source

    delete_renderbuffer

    fn delete_renderbuffer(self: &Self, renderbuffer: i32)
    

    Deletes one renderbuffer object.

    Source

    gen_texture

    fn gen_texture(self: &Self) -> i32
    

    Creates one texture object.

    Source

    delete_texture

    fn delete_texture(self: &Self, texture: i32)
    

    Deletes one texture object.

    Source

    shader_source_string

    fn shader_source_string(self: &Self, shader: i32, source: &str)
    

    Replaces the source of a shader.

    Source

    compile_shader_and_get_error

    fn compile_shader_and_get_error(self: &Self, shader: i32, source: &str) -> Option<String>
    

    Compiles source as the shader. Returns the compiler's log when the compilation fails and None when it succeeds.

    Source

    fn link_program_and_get_error(self: &Self, program: i32) -> Option<String>
    

    Links the program. Returns the linker's log when linking fails and None when it succeeds.

    Source

    bind_attrib_location_string

    fn bind_attrib_location_string(self: &Self, program: i32, index: i32, name: &str)
    

    Binds a vertex attribute of the program to a location.

    Source

    gen_buffer

    fn gen_buffer(self: &Self) -> i32
    

    Creates one buffer object.

    Source

    get_attrib_location_string

    fn get_attrib_location_string(self: &Self, program: i32, name: &str) -> i32
    

    The location of a vertex attribute of the program.

    Source

    get_uniform_location_string

    fn get_uniform_location_string(self: &Self, program: i32, name: &str) -> i32
    

    The location of a uniform of the program.

    Source

    delete_buffer

    fn delete_buffer(self: &Self, buffer: i32)
    

    Deletes one buffer object.

    Source

    get_renderbuffer_parameteriv

    fn get_renderbuffer_parameteriv(self: &Self, target: i32, name: i32) -> i32
    

    glGetRenderbufferParameteriv for a parameter with one value.

    Source

    delete_vertex_array

    fn delete_vertex_array(self: &Self, array: i32)
    

    Deletes one vertex array object.

    Source

    gen_vertex_array

    fn gen_vertex_array(self: &Self) -> i32
    

    Creates one vertex array object.

    Source

    from_native_utf8_get_proc_address

    unsafe fn from_native_utf8_get_proc_address(version: GlVersion, get_proc_address: impl Fn(*const c_char) -> *const c_void + 'static) -> GlInterface
    

    Creates the interface from a loader that takes a NUL-terminated name.

    Safety

    See GlInterface::new; get_proc_address must in addition accept a pointer to a NUL-terminated name that is only valid during the call.

    Source

    Trait implementations

    • Send
    • Sync
    • Freeze
    • UnsafeUnpin
    • Unpin
    • UnwindSafe
    • RefUnwindSafe
    • Borrow<T>
    • BorrowMut<T>
    • Into<U>
    • From<T>
    • TryInto<U>
    • TryFrom<U>
    • Receiver
    • Any
    • ClassDefaults
    • ErasedDestructor
    • IntoEither
    • Deref

    Availability

    Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.