Questions tagged [glium]

Safe OpenGL wrapper for the Rust language

30 questions
1
vote
1 answer

Efficient 2D rendering with Glium

I'm using Glium to do rendering for an emulator I'm writing. I've pieced together something that works (based on this example) but I suspect that it's pretty inefficient. Here's the relevant function: fn update_screen(display: &Display, screen:…
w.brian
  • 16,296
  • 14
  • 69
  • 118
0
votes
0 answers

How do you use Rust glium with openxr in a VR headset?

I am working on a Rust NDK app (uses #[no_mangle] fn android_main(android_app:android_activity::AndroidApp) ; compatible with cargo apk run) I have a version that works with glium #[no_mangle] fn android_main(android_app: AndroidApp) { …
Mutant Bob
  • 3,121
  • 2
  • 27
  • 52
0
votes
1 answer

How to draw rotating cube glium?

Why is my rotating cube doesn't looks like rotating cube? Do I need to move camera? I don't have any idea what is wrong. I am using glium in rust. 24 Vertices const P: f32 = 0.5; let vertex_buffer = glium::VertexBuffer::new(&display, &vec![ …
0
votes
1 answer

rust glium compile error missing package on ubuntu

I try compile this in Rust with glium on an Ubutnu machine. #[macro_use] extern crate glium; fn main() { println!("Hello, world!"); } It results in this error: --- stderr thread 'main' panicked at '`"pkg-config" "--libs" "--cflags"…
0
votes
0 answers

implementing obj-rs example to glium

I am trying to load a model into glium, I am using crate obj-rs for this. My model works fine with this example. Unfortunately whenever I try to move code from the example to my project (which is basically code copied from here) I fail with an…
pggu11
  • 3
  • 1
0
votes
1 answer

Very Slow and Choppy Camera Controller in Rust

I am currently working on simple Rendering in Rust using the OpenGL Wrapper Glium. I have a simple 3D model and a Camera ready set up and started working on a fitting camera controller. I'm using device_query to check for keyboard input and if it's…
Teer 2008
  • 79
  • 1
  • 7
0
votes
1 answer

How can I get the mouse X and Y in Glium + Glutin?

I use Glium to write a game where I have to render an image in a specific position when a click is detected. To do so, I need to get the X and Y position. So how do I get them? My current code looks like this: /* ... */ event.run(move |event, _,…
AggelosT
  • 108
  • 1
  • 9
0
votes
0 answers

How to write to a pixel buffer line by line in glium?

When uploading a decoded image to a pixel buffer, sometimes the lines contain a stride. That is, the lines are bigger than the image lines, for performance reasons (alignment). So if we want to upload the image called slice, we either upload it…
Guerlando OCs
  • 1,886
  • 9
  • 61
  • 150
0
votes
0 answers

How to fill non RGB OpenGL texture in glium?

I use OpenGL shaders to do color conversion from YUV to RGB. For example, on YUV420P, I create 3 textures (one for Y, one for U, one for V) and use the texture GLSL call to get each texture. Then I use matrix multiplication to get the RGB value.…
PPP
  • 1,279
  • 1
  • 28
  • 71
0
votes
1 answer

Drag move flickers position of window

I'm implementing a Rust alternative to .NET's DragMove method however the result causes the application to flicker between two relative positions. See screencast and sample project. Code I'm using to perform the drag move: let mut mouse_down =…
Paul
  • 42
  • 5
  • 19
0
votes
1 answer

Circumventing closure-borrowed variable lifetime limits

I'm using the following code in order to run my render::exec function on each occurrence of a RedrawRequested event (issued by Glium): event_loop.run(move |event, _, control_flow| { match event { Event::RedrawRequested(_) => { …
Algorythmis
  • 642
  • 1
  • 7
  • 19
0
votes
1 answer

Set frame redraw rate in glium?

I am trying to make a game loop using glium in rust. My goal is to get the screen to redraw 60 times per second. With the current event loop code I have, the frame only gets redrawn when the window size changes. I read in the glutin docs, that I…
Ian Rehwinkel
  • 2,486
  • 5
  • 22
  • 56
0
votes
1 answer

Output to display with Rust bare metal

I'm following along with the Phil-Opp tutorials on creating an OS, and I'm trying to figure out how to control my display/screen, after having successfully gotten VGA output to work. How does one control the display? I'm assuming you have to write a…
Ben Gubler
  • 1,393
  • 3
  • 18
  • 32
0
votes
1 answer

Cannot find `glutin` in `glium` when using Conrod

I am attempting to add a GUI to a small project of mine using Conrod. I have managed to work my way down to 3 compilation errors: error[E0433]: failed to resolve. Could not find `glutin` in `glium` --> src/support/mod.rs:88:53 | 88 | pub fn…
jmcph4
  • 197
  • 2
  • 8
0
votes
1 answer

Why does calling XChangeProperty from Rust and Glium generate a segfault?

I'm trying to make an xlib call from Rust and I can't figure out why this code is giving me a segfault. main.rs: extern crate glium; extern crate x11; fn main() { let mut events_loop = glium::glutin::EventsLoop::new(); let context =…
Aylmoa
  • 1
  • 2
1
2