init gl in frontend interface
authoralfadur
Fri, 22 Mar 2019 20:37:21 +0300
changeset 14727 88b0efba77b9
parent 14726 19122a329774
child 14728 5237b4c44d11
init gl in frontend interface
rust/lib-hedgewars-engine/Cargo.toml
rust/lib-hedgewars-engine/src/lib.rs
--- a/rust/lib-hedgewars-engine/Cargo.toml	Fri Mar 22 20:26:29 2019 +0300
+++ b/rust/lib-hedgewars-engine/Cargo.toml	Fri Mar 22 20:37:21 2019 +0300
@@ -6,8 +6,6 @@
 
 [dependencies]
 gl = "0.11"
-#gfx = "0.17"
-#gfx_device_gl = "0.15"
 netbuf = "0.4"
 
 fpnum = { path = "../fpnum" }
--- a/rust/lib-hedgewars-engine/src/lib.rs	Fri Mar 22 20:26:29 2019 +0300
+++ b/rust/lib-hedgewars-engine/src/lib.rs	Fri Mar 22 20:37:21 2019 +0300
@@ -81,6 +81,11 @@
     height: u16,
     gl_loader: extern "C" fn(*const c_char) -> *const c_void,
 ) {
+    gl::load_with(|name| {
+        let c_name = CString::new(name).unwrap();
+        gl_loader(c_name.as_ptr())
+    });
+    unsafe { gl::Viewport(0, 0, width as i32, height as i32); }
     engine_state.world.create_renderer(width, height);
 }