I am converting an application that needs to draw a complex 3d map in one area of the window.
I followed the Glium example and got a good working prototype, but had performance as glium doesn’t support glMultiDrawArrays
or similar, so am trying to use a plain GLArea.
But as soon as I try to render anything. I get a panic
gl function was not loaded
I am creating the UI using composite template and binding to GLArea widget with
#[template_child]
gl_area: TemplateChild<GLArea>,
and connecting the renderring up as follows
impl ObjectImpl for WorldMapView {
fn constructed(&self) {
self.parent_constructed();
self.gl_area.connect_render( |area, context| unsafe {
gl::ClearColor(0.0, 0.0, 1.0, 1.0);
gl::Clear(gl::COLOR_BUFFER_BIT);
Inhibit{ 0: false }
});
}
}
It panics on the first gl call.
I have read some replies here saying GTK depends on OpenGL and the gl functions should already be loaded, but I have tried loading them as in the Glium example, but that, unsurprisingly, didn’t work.
No idea how to proceed now.