@@ -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