Skip to content

Commit

Permalink
Error checking has messages
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexApps99 committed Oct 10, 2021
1 parent 6c41968 commit d9de1ed
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 131 deletions.
124 changes: 0 additions & 124 deletions egui_glium/examples/native_texture.rs

This file was deleted.

4 changes: 1 addition & 3 deletions egui_glium/src/backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,7 @@ impl epi::TextureAllocator for Painter {

struct RequestRepaintEvent;

struct GlowRepaintSignal(
std::sync::Mutex<glutin::event_loop::EventLoopProxy<RequestRepaintEvent>>,
);
struct GlowRepaintSignal(std::sync::Mutex<glutin::event_loop::EventLoopProxy<RequestRepaintEvent>>);

impl epi::RepaintSignal for GlowRepaintSignal {
fn request_repaint(&self) {
Expand Down
8 changes: 4 additions & 4 deletions egui_glium/src/painter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ fn srgbtexture2d(gl: &glow::Context, data: &[u8], w: usize, h: usize) -> glow::N
glow::PixelUnpackData::Slice(data),
);

assert_eq!(gl.get_error(), glow::NO_ERROR);
assert_eq!(gl.get_error(), glow::NO_ERROR, "OpenGL error occurred!");
tex
}
}
Expand Down Expand Up @@ -169,7 +169,6 @@ impl Painter {
v_src.push_str(VERT_SRC);
let mut f_src = header.to_owned();
f_src.push_str(FRAG_SRC);
// TODO error handling
unsafe {
let v = gl.create_shader(glow::VERTEX_SHADER).unwrap();
gl.shader_source(v, &v_src);
Expand Down Expand Up @@ -246,7 +245,7 @@ impl Painter {
offset_of!(Vertex, color) as i32,
);
gl.enable_vertex_attrib_array(a_srgba_loc);
assert_eq!(gl.get_error(), glow::NO_ERROR);
assert_eq!(gl.get_error(), glow::NO_ERROR, "OpenGL error occurred!");

Painter {
program,
Expand Down Expand Up @@ -331,6 +330,7 @@ impl Painter {
gl.bind_vertex_array(Some(self.vertex_array));
gl.bind_buffer(glow::ARRAY_BUFFER, Some(self.vertex_buffer));
gl.bind_buffer(glow::ELEMENT_ARRAY_BUFFER, Some(self.element_array_buffer));

(width_in_pixels, height_in_pixels)
}

Expand Down Expand Up @@ -372,7 +372,7 @@ impl Painter {
self.paint_mesh(gl, size_in_pixels, pixels_per_point, clip_rect, &mesh)
}

assert_eq!(unsafe { gl.get_error() }, glow::NO_ERROR);
assert_eq!(unsafe { gl.get_error() }, glow::NO_ERROR, "OpenGL error occurred!");
}

#[inline(never)] // Easier profiling
Expand Down

0 comments on commit d9de1ed

Please sign in to comment.