| 1 | pub mod direct_contexts { |
|---|---|
| 2 | use skia_bindings as sb; |
| 3 | |
| 4 | use crate::{ |
| 5 | gpu::{gl, ContextOptions, DirectContext}, |
| 6 | prelude::*, |
| 7 | }; |
| 8 | |
| 9 | pub fn make_gl<'a>( |
| 10 | interface: impl Into<gl::Interface>, |
| 11 | options: impl Into<Option<&'a ContextOptions>>, |
| 12 | ) -> Option<DirectContext> { |
| 13 | DirectContext::from_ptr(unsafe { |
| 14 | sb::C_GrDirectContext_MakeGL( |
| 15 | interface.into().into_ptr(), |
| 16 | options.into().native_ptr_or_null(), |
| 17 | ) |
| 18 | }) |
| 19 | } |
| 20 | } |
| 21 |
