Skip to content

Commit

Permalink
Load the texture just when needed
Browse files Browse the repository at this point in the history
This fixes the issue of colliding somewhere with GTK
  • Loading branch information
faern committed Mar 27, 2024
1 parent ec261ac commit e4f3f3f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion examples/texture.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,13 +113,14 @@ fn main() {

let facade = GtkFacade::from_glarea(&glarea).unwrap();

let opengl_texture = load_texture(&facade);
let vertex_buffer = create_rectangle_buffer(&facade);
let program = create_program(&facade);

glarea.connect_render(move |_glarea, _glcontext| {
let context = facade.get_context();

let opengl_texture = load_texture(&facade);

let uniforms = uniform! {
matrix: [
[1.0, 0.0, 0.0, 0.0],
Expand Down

0 comments on commit e4f3f3f

Please sign in to comment.