Skip to content

Commit 0edc2c6

Browse files
authored
Merge pull request #27 from aumouvantsillage/master
Fixed runtime error at GL context creation
2 parents 7241c8b + 519299b commit 0edc2c6

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

loopers-gui/src/skia.rs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use skia_safe::gpu::gl::FramebufferInfo;
1+
use skia_safe::gpu::gl::{FramebufferInfo, Interface};
22
use skia_safe::gpu::{BackendRenderTarget, DirectContext, SurfaceOrigin};
33
use skia_safe::{
44
Color, ColorType, Font, Paint, PictureRecorder, Point, Rect, Size, Surface, TextBlob, Typeface,
@@ -87,7 +87,14 @@ pub fn skia_main(mut gui: Gui) {
8787

8888
let debug = std::env::var("DEBUG").is_ok();
8989

90-
let mut gr_context = DirectContext::new_gl(None, None).unwrap();
90+
let interface = Interface::new_load_with(|name| {
91+
if name == "eglGetCurrentDisplay" {
92+
return std::ptr::null();
93+
}
94+
video_subsystem.gl_get_proc_address(&name) as *const _
95+
});
96+
97+
let mut gr_context = DirectContext::new_gl(interface, None).unwrap();
9198

9299
let mut fboid: GLint = 0;
93100
unsafe { gl::GetIntegerv(gl::FRAMEBUFFER_BINDING, &mut fboid) };

0 commit comments

Comments
 (0)