Skip to content

Commit d9de1ed

Browse files
committed
Error checking has messages
1 parent 6c41968 commit d9de1ed

File tree

3 files changed

+5
-131
lines changed

3 files changed

+5
-131
lines changed

egui_glium/examples/native_texture.rs

Lines changed: 0 additions & 124 deletions
This file was deleted.

egui_glium/src/backend.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,7 @@ impl epi::TextureAllocator for Painter {
4848

4949
struct RequestRepaintEvent;
5050

51-
struct GlowRepaintSignal(
52-
std::sync::Mutex<glutin::event_loop::EventLoopProxy<RequestRepaintEvent>>,
53-
);
51+
struct GlowRepaintSignal(std::sync::Mutex<glutin::event_loop::EventLoopProxy<RequestRepaintEvent>>);
5452

5553
impl epi::RepaintSignal for GlowRepaintSignal {
5654
fn request_repaint(&self) {

egui_glium/src/painter.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ fn srgbtexture2d(gl: &glow::Context, data: &[u8], w: usize, h: usize) -> glow::N
5050
glow::PixelUnpackData::Slice(data),
5151
);
5252

53-
assert_eq!(gl.get_error(), glow::NO_ERROR);
53+
assert_eq!(gl.get_error(), glow::NO_ERROR, "OpenGL error occurred!");
5454
tex
5555
}
5656
}
@@ -169,7 +169,6 @@ impl Painter {
169169
v_src.push_str(VERT_SRC);
170170
let mut f_src = header.to_owned();
171171
f_src.push_str(FRAG_SRC);
172-
// TODO error handling
173172
unsafe {
174173
let v = gl.create_shader(glow::VERTEX_SHADER).unwrap();
175174
gl.shader_source(v, &v_src);
@@ -246,7 +245,7 @@ impl Painter {
246245
offset_of!(Vertex, color) as i32,
247246
);
248247
gl.enable_vertex_attrib_array(a_srgba_loc);
249-
assert_eq!(gl.get_error(), glow::NO_ERROR);
248+
assert_eq!(gl.get_error(), glow::NO_ERROR, "OpenGL error occurred!");
250249

251250
Painter {
252251
program,
@@ -331,6 +330,7 @@ impl Painter {
331330
gl.bind_vertex_array(Some(self.vertex_array));
332331
gl.bind_buffer(glow::ARRAY_BUFFER, Some(self.vertex_buffer));
333332
gl.bind_buffer(glow::ELEMENT_ARRAY_BUFFER, Some(self.element_array_buffer));
333+
334334
(width_in_pixels, height_in_pixels)
335335
}
336336

@@ -372,7 +372,7 @@ impl Painter {
372372
self.paint_mesh(gl, size_in_pixels, pixels_per_point, clip_rect, &mesh)
373373
}
374374

375-
assert_eq!(unsafe { gl.get_error() }, glow::NO_ERROR);
375+
assert_eq!(unsafe { gl.get_error() }, glow::NO_ERROR, "OpenGL error occurred!");
376376
}
377377

378378
#[inline(never)] // Easier profiling

0 commit comments

Comments
 (0)