1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
extern crate alloc;
pub
pub
use ;
/// Load OpenGL and WGL functions, using the provided function to get the address of each function.
/// This needs to be called before using any OpenGL or WGL functions.
///
/// # Example
///
/// ```ignore
/// use windows_sys::Win32::Graphics::OpenGL::wglGetProcAddress;
/// use windows_sys::Win32::System::LibraryLoader::{GetProcAddress, LoadLibraryA};
///
/// let opengl32 = LoadLibraryA(c"opengl32.dll".as_ptr() as _);
///
/// unsafe {
/// tiny_gl::load(|name| {
/// let addr = wglGetProcAddress(name.as_ptr() as _).map(|ptr| ptr as *const c_void).unwrap_or(core::ptr::null());
/// if addr.is_null() {
/// GetProcAddress(opengl32, name.as_ptr() as _).unwrap() as _
/// } else {
/// addr as _
/// }
/// });
/// }
/// ```
pub unsafe