#[repr(C)]pub struct GlContextPtr {
pub ptr: ManuallyDrop<Box<Rc<GlContextPtrInner>>>,
pub renderer_type: RendererType,
pub run_destructor: bool,
}Fields§
§ptr: ManuallyDrop<Box<Rc<GlContextPtrInner>>>ManuallyDrop so the owned Box is freed ONLY when run_destructor is
still set (see Drop). The codegen FFI wrappers (AzTexture etc.) embed
this by value AND have their own Drop that drop_in_places the real
type first; Rust’s drop glue would then drop this field a SECOND time on
the same bytes. Gating the Box free on run_destructor (which the first
drop clears in the shared memory) makes that second drop a safe no-op.
Layout is unchanged: ManuallyDrop<Box<T>> is a single pointer, identical
to the old Box<T> and to the FFI *mut c_void.
renderer_type: RendererTypeWhether to force a hardware or software renderer
run_destructor: boolImplementations§
Source§impl GlContextPtr
impl GlContextPtr
pub fn get_svg_shader(&self) -> GLuint
Sourcepub fn is_gl_usable(&self) -> bool
pub fn is_gl_usable(&self) -> bool
Whether this hardware GL context proved usable at construction (the SVG
shaders compiled+linked at some GLSL version). false means context
creation succeeded but the driver can’t run our shaders – the caller
should fall back to CPU rendering. Always false for a Software context
(which never compiles these shaders); only meaningful on the GPU path.
Sourcepub fn get_usable_glsl_version(&self) -> AzString
pub fn get_usable_glsl_version(&self) -> AzString
The GLSL #version the driver accepted at construction (e.g. “150” or
“300 es”), discovered by the probe. Empty string if the context is
unusable / software. Exposed in the API so apps can report/branch on it.
Sourcepub fn get_brush_shader(&self) -> GLuint
pub fn get_brush_shader(&self) -> GLuint
Soft-brush shader program for the GPU painting API (0 if unusable).