yog-runtime 0.111.0

Yog runtime — native library bridging the Fabric host to Rust mods via JNI.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
//! The OpenGL context (client side, render thread only).
use yog_sync::OnceLock;

// ── OpenGL context (client-side, render thread only) ─────────────────────────

pub(crate) struct GlCtx(pub(crate) glow::Context);
unsafe impl Send for GlCtx {}
unsafe impl Sync for GlCtx {}

/// Initialized by `nativeGlInit` on the render thread.  `None` on dedicated server.
pub(crate) static GL: OnceLock<GlCtx> = OnceLock::new();

// Raw GL function pointers for GL_ARB_get_program_binary (not exposed by glow 0.13).
// Captured during the glow loader callback in `nativeGlInit`.
// `None` when the extension is unavailable (very old drivers).
pub(crate) static GL_GET_PROGRAM_BINARY: OnceLock<Option<usize>> = OnceLock::new();
pub(crate) static GL_PROGRAM_BINARY: OnceLock<Option<usize>> = OnceLock::new();
pub(crate) static GL_GET_PROGRAM_IV: OnceLock<Option<usize>> = OnceLock::new();