@@ -143,15 +143,15 @@ struct ShaderProgram {
143
143
144
144
impl ShaderProgram {
145
145
pub fn new ( vertex_shader_source : & str , fragment_shader_source : & str ) -> ShaderProgram {
146
- unsafe { assert_eq ! ( gl:: GetError ( ) , gl:: NO_ERROR ) ; }
146
+ unsafe { if cfg ! ( feature = "gldebug" ) { assert_eq ! ( gl:: GetError ( ) , gl:: NO_ERROR ) ; } }
147
147
let id = gl:: create_program ( ) ;
148
- unsafe { assert_eq ! ( gl:: GetError ( ) , gl:: NO_ERROR ) ; }
148
+ unsafe { if cfg ! ( feature = "gldebug" ) { assert_eq ! ( gl:: GetError ( ) , gl:: NO_ERROR ) ; } }
149
149
gl:: attach_shader ( id, ShaderProgram :: compile_shader ( fragment_shader_source, gl:: FRAGMENT_SHADER ) ) ;
150
- unsafe { assert_eq ! ( gl:: GetError ( ) , gl:: NO_ERROR ) ; }
150
+ unsafe { if cfg ! ( feature = "gldebug" ) { assert_eq ! ( gl:: GetError ( ) , gl:: NO_ERROR ) ; } }
151
151
gl:: attach_shader ( id, ShaderProgram :: compile_shader ( vertex_shader_source, gl:: VERTEX_SHADER ) ) ;
152
- unsafe { assert_eq ! ( gl:: GetError ( ) , gl:: NO_ERROR ) ; }
152
+ unsafe { if cfg ! ( feature = "gldebug" ) { assert_eq ! ( gl:: GetError ( ) , gl:: NO_ERROR ) ; } }
153
153
gl:: link_program ( id) ;
154
- unsafe { assert_eq ! ( gl:: GetError ( ) , gl:: NO_ERROR ) ; }
154
+ unsafe { if cfg ! ( feature = "gldebug" ) { assert_eq ! ( gl:: GetError ( ) , gl:: NO_ERROR ) ; } }
155
155
if gl:: get_program_iv ( id, gl:: LINK_STATUS ) == ( 0 as GLint ) {
156
156
panic ! ( "Failed to compile shader program: {}" , gl:: get_program_info_log( id) ) ;
157
157
}
@@ -163,11 +163,11 @@ impl ShaderProgram {
163
163
164
164
pub fn compile_shader ( source_string : & str , shader_type : GLenum ) -> GLuint {
165
165
let id = gl:: create_shader ( shader_type) ;
166
- unsafe { assert_eq ! ( gl:: GetError ( ) , gl:: NO_ERROR ) ; }
166
+ unsafe { if cfg ! ( feature = "gldebug" ) { assert_eq ! ( gl:: GetError ( ) , gl:: NO_ERROR ) ; } }
167
167
gl:: shader_source ( id, & [ source_string. as_bytes ( ) ] ) ;
168
- unsafe { assert_eq ! ( gl:: GetError ( ) , gl:: NO_ERROR ) ; }
168
+ unsafe { if cfg ! ( feature = "gldebug" ) { assert_eq ! ( gl:: GetError ( ) , gl:: NO_ERROR ) ; } }
169
169
gl:: compile_shader ( id) ;
170
- unsafe { assert_eq ! ( gl:: GetError ( ) , gl:: NO_ERROR ) ; }
170
+ unsafe { if cfg ! ( feature = "gldebug" ) { assert_eq ! ( gl:: GetError ( ) , gl:: NO_ERROR ) ; } }
171
171
if gl:: get_shader_iv ( id, gl:: COMPILE_STATUS ) == ( 0 as GLint ) {
172
172
panic ! ( "Failed to compile shader: {}" , gl:: get_shader_info_log( id) ) ;
173
173
}
@@ -224,43 +224,43 @@ impl TextureProgram {
224
224
buffers : & Buffers ,
225
225
opacity : f32 ) {
226
226
gl:: uniform_1i ( self . sampler_uniform , 0 ) ;
227
- unsafe { assert_eq ! ( gl:: GetError ( ) , gl:: NO_ERROR ) ; }
227
+ unsafe { if cfg ! ( feature = "gldebug" ) { assert_eq ! ( gl:: GetError ( ) , gl:: NO_ERROR ) ; } }
228
228
gl:: uniform_matrix_4fv ( self . modelview_uniform , false , & transform. to_array ( ) ) ;
229
- unsafe { assert_eq ! ( gl:: GetError ( ) , gl:: NO_ERROR ) ; }
229
+ unsafe { if cfg ! ( feature = "gldebug" ) { assert_eq ! ( gl:: GetError ( ) , gl:: NO_ERROR ) ; } }
230
230
gl:: uniform_matrix_4fv ( self . projection_uniform , false , & projection_matrix. to_array ( ) ) ;
231
- unsafe { assert_eq ! ( gl:: GetError ( ) , gl:: NO_ERROR ) ; }
231
+ unsafe { if cfg ! ( feature = "gldebug" ) { assert_eq ! ( gl:: GetError ( ) , gl:: NO_ERROR ) ; } }
232
232
233
233
let vertex_size = mem:: size_of :: < TextureVertex > ( ) ;
234
234
235
235
gl:: bind_buffer ( gl:: ARRAY_BUFFER , buffers. quad_vertex_buffer ) ;
236
- unsafe { assert_eq ! ( gl:: GetError ( ) , gl:: NO_ERROR ) ; }
236
+ unsafe { if cfg ! ( feature = "gldebug" ) { assert_eq ! ( gl:: GetError ( ) , gl:: NO_ERROR ) ; } }
237
237
gl:: buffer_data ( gl:: ARRAY_BUFFER , vertices, gl:: DYNAMIC_DRAW ) ;
238
- unsafe { assert_eq ! ( gl:: GetError ( ) , gl:: NO_ERROR ) ; }
238
+ unsafe { if cfg ! ( feature = "gldebug" ) { assert_eq ! ( gl:: GetError ( ) , gl:: NO_ERROR ) ; } }
239
239
gl:: vertex_attrib_pointer_f32 ( self . vertex_position_attr as GLuint , 2 , false , vertex_size as i32 , 0 ) ;
240
- unsafe { assert_eq ! ( gl:: GetError ( ) , gl:: NO_ERROR ) ; }
240
+ unsafe { if cfg ! ( feature = "gldebug" ) { assert_eq ! ( gl:: GetError ( ) , gl:: NO_ERROR ) ; } }
241
241
gl:: vertex_attrib_pointer_f32 ( self . vertex_uv_attr as GLuint , 2 , false , vertex_size as i32 , 8 ) ;
242
- unsafe { assert_eq ! ( gl:: GetError ( ) , gl:: NO_ERROR ) ; }
242
+ unsafe { if cfg ! ( feature = "gldebug" ) { assert_eq ! ( gl:: GetError ( ) , gl:: NO_ERROR ) ; } }
243
243
244
244
gl:: uniform_matrix_4fv ( self . texture_space_transform_uniform ,
245
245
false ,
246
246
& texture_space_transform. to_array ( ) ) ;
247
- unsafe { assert_eq ! ( gl:: GetError ( ) , gl:: NO_ERROR ) ; }
247
+ unsafe { if cfg ! ( feature = "gldebug" ) { assert_eq ! ( gl:: GetError ( ) , gl:: NO_ERROR ) ; } }
248
248
249
249
gl:: uniform_1f ( self . opacity_uniform , opacity) ;
250
- unsafe { assert_eq ! ( gl:: GetError ( ) , gl:: NO_ERROR ) ; }
250
+ unsafe { if cfg ! ( feature = "gldebug" ) { assert_eq ! ( gl:: GetError ( ) , gl:: NO_ERROR ) ; } }
251
251
}
252
252
253
253
fn enable_attribute_arrays ( & self ) {
254
254
gl:: enable_vertex_attrib_array ( self . vertex_position_attr as GLuint ) ;
255
- unsafe { assert_eq ! ( gl:: GetError ( ) , gl:: NO_ERROR ) ; }
255
+ unsafe { if cfg ! ( feature = "gldebug" ) { assert_eq ! ( gl:: GetError ( ) , gl:: NO_ERROR ) ; } }
256
256
gl:: enable_vertex_attrib_array ( self . vertex_uv_attr as GLuint ) ;
257
- unsafe { assert_eq ! ( gl:: GetError ( ) , gl:: NO_ERROR ) ; }
257
+ unsafe { if cfg ! ( feature = "gldebug" ) { assert_eq ! ( gl:: GetError ( ) , gl:: NO_ERROR ) ; } }
258
258
}
259
259
260
260
fn disable_attribute_arrays ( & self ) {
261
261
gl:: disable_vertex_attrib_array ( self . vertex_uv_attr as GLuint ) ;
262
262
gl:: disable_vertex_attrib_array ( self . vertex_position_attr as GLuint ) ;
263
- unsafe { assert_eq ! ( gl:: GetError ( ) , gl:: NO_ERROR ) ; }
263
+ unsafe { if cfg ! ( feature = "gldebug" ) { assert_eq ! ( gl:: GetError ( ) , gl:: NO_ERROR ) ; } }
264
264
}
265
265
266
266
fn create_2d_program ( ) -> TextureProgram {
@@ -270,7 +270,7 @@ impl TextureProgram {
270
270
#[ cfg( target_os="macos" ) ]
271
271
fn create_rectangle_program_if_necessary ( ) -> Option < TextureProgram > {
272
272
gl:: enable ( gl:: TEXTURE_RECTANGLE_ARB ) ;
273
- unsafe { assert_eq ! ( gl:: GetError ( ) , gl:: NO_ERROR ) ; }
273
+ unsafe { if cfg ! ( feature = "gldebug" ) { assert_eq ! ( gl:: GetError ( ) , gl:: NO_ERROR ) ; } }
274
274
Some ( TextureProgram :: new ( "texture2DRect" , "sampler2DRect" ) )
275
275
}
276
276
@@ -307,15 +307,15 @@ impl SolidColorProgram {
307
307
projection_matrix : & Matrix4 ,
308
308
color : & Color ) {
309
309
gl:: uniform_matrix_4fv ( self . modelview_uniform , false , & transform. to_array ( ) ) ;
310
- unsafe { assert_eq ! ( gl:: GetError ( ) , gl:: NO_ERROR ) ; }
310
+ unsafe { if cfg ! ( feature = "gldebug" ) { assert_eq ! ( gl:: GetError ( ) , gl:: NO_ERROR ) ; } }
311
311
gl:: uniform_matrix_4fv ( self . projection_uniform , false , & projection_matrix. to_array ( ) ) ;
312
- unsafe { assert_eq ! ( gl:: GetError ( ) , gl:: NO_ERROR ) ; }
312
+ unsafe { if cfg ! ( feature = "gldebug" ) { assert_eq ! ( gl:: GetError ( ) , gl:: NO_ERROR ) ; } }
313
313
gl:: uniform_4f ( self . color_uniform ,
314
314
color. r as GLfloat ,
315
315
color. g as GLfloat ,
316
316
color. b as GLfloat ,
317
317
color. a as GLfloat ) ;
318
- unsafe { assert_eq ! ( gl:: GetError ( ) , gl:: NO_ERROR ) ; }
318
+ unsafe { if cfg ! ( feature = "gldebug" ) { assert_eq ! ( gl:: GetError ( ) , gl:: NO_ERROR ) ; } }
319
319
}
320
320
321
321
fn bind_uniforms_and_attributes_for_lines ( & self ,
@@ -327,11 +327,11 @@ impl SolidColorProgram {
327
327
self . bind_uniforms_and_attributes_common ( transform, projection_matrix, color) ;
328
328
329
329
gl:: bind_buffer ( gl:: ARRAY_BUFFER , buffers. line_quad_vertex_buffer ) ;
330
- unsafe { assert_eq ! ( gl:: GetError ( ) , gl:: NO_ERROR ) ; }
330
+ unsafe { if cfg ! ( feature = "gldebug" ) { assert_eq ! ( gl:: GetError ( ) , gl:: NO_ERROR ) ; } }
331
331
gl:: buffer_data ( gl:: ARRAY_BUFFER , vertices, gl:: DYNAMIC_DRAW ) ;
332
- unsafe { assert_eq ! ( gl:: GetError ( ) , gl:: NO_ERROR ) ; }
332
+ unsafe { if cfg ! ( feature = "gldebug" ) { assert_eq ! ( gl:: GetError ( ) , gl:: NO_ERROR ) ; } }
333
333
gl:: vertex_attrib_pointer_f32 ( self . vertex_position_attr as GLuint , 2 , false , 0 , 0 ) ;
334
- unsafe { assert_eq ! ( gl:: GetError ( ) , gl:: NO_ERROR ) ; }
334
+ unsafe { if cfg ! ( feature = "gldebug" ) { assert_eq ! ( gl:: GetError ( ) , gl:: NO_ERROR ) ; } }
335
335
}
336
336
337
337
fn bind_uniforms_and_attributes_for_quad ( & self ,
@@ -343,21 +343,21 @@ impl SolidColorProgram {
343
343
self . bind_uniforms_and_attributes_common ( transform, projection_matrix, color) ;
344
344
345
345
gl:: bind_buffer ( gl:: ARRAY_BUFFER , buffers. quad_vertex_buffer ) ;
346
- unsafe { assert_eq ! ( gl:: GetError ( ) , gl:: NO_ERROR ) ; }
346
+ unsafe { if cfg ! ( feature = "gldebug" ) { assert_eq ! ( gl:: GetError ( ) , gl:: NO_ERROR ) ; } }
347
347
gl:: buffer_data ( gl:: ARRAY_BUFFER , vertices, gl:: DYNAMIC_DRAW ) ;
348
- unsafe { assert_eq ! ( gl:: GetError ( ) , gl:: NO_ERROR ) ; }
348
+ unsafe { if cfg ! ( feature = "gldebug" ) { assert_eq ! ( gl:: GetError ( ) , gl:: NO_ERROR ) ; } }
349
349
gl:: vertex_attrib_pointer_f32 ( self . vertex_position_attr as GLuint , 2 , false , 0 , 0 ) ;
350
- unsafe { assert_eq ! ( gl:: GetError ( ) , gl:: NO_ERROR ) ; }
350
+ unsafe { if cfg ! ( feature = "gldebug" ) { assert_eq ! ( gl:: GetError ( ) , gl:: NO_ERROR ) ; } }
351
351
}
352
352
353
353
fn enable_attribute_arrays ( & self ) {
354
354
gl:: enable_vertex_attrib_array ( self . vertex_position_attr as GLuint ) ;
355
- unsafe { assert_eq ! ( gl:: GetError ( ) , gl:: NO_ERROR ) ; }
355
+ unsafe { if cfg ! ( feature = "gldebug" ) { assert_eq ! ( gl:: GetError ( ) , gl:: NO_ERROR ) ; } }
356
356
}
357
357
358
358
fn disable_attribute_arrays ( & self ) {
359
359
gl:: disable_vertex_attrib_array ( self . vertex_position_attr as GLuint ) ;
360
- unsafe { assert_eq ! ( gl:: GetError ( ) , gl:: NO_ERROR ) ; }
360
+ unsafe { if cfg ! ( feature = "gldebug" ) { assert_eq ! ( gl:: GetError ( ) , gl:: NO_ERROR ) ; } }
361
361
}
362
362
}
363
363
@@ -515,15 +515,15 @@ impl RenderContext {
515
515
pub fn new ( compositing_display : NativeDisplay ,
516
516
show_debug_borders : bool ,
517
517
force_near_texture_filter : bool ) -> RenderContext {
518
- unsafe { assert_eq ! ( gl:: GetError ( ) , gl:: NO_ERROR ) ; }
518
+ unsafe { if cfg ! ( feature = "gldebug" ) { assert_eq ! ( gl:: GetError ( ) , gl:: NO_ERROR ) ; } }
519
519
gl:: enable ( gl:: TEXTURE_2D ) ;
520
- unsafe { assert_eq ! ( gl:: GetError ( ) , gl:: NO_ERROR ) ; }
520
+ unsafe { if cfg ! ( feature = "gldebug" ) { assert_eq ! ( gl:: GetError ( ) , gl:: NO_ERROR ) ; } }
521
521
522
522
// Each layer uses premultiplied alpha!
523
523
gl:: enable ( gl:: BLEND ) ;
524
- unsafe { assert_eq ! ( gl:: GetError ( ) , gl:: NO_ERROR ) ; }
524
+ unsafe { if cfg ! ( feature = "gldebug" ) { assert_eq ! ( gl:: GetError ( ) , gl:: NO_ERROR ) ; } }
525
525
gl:: blend_func ( gl:: ONE , gl:: ONE_MINUS_SRC_ALPHA ) ;
526
- unsafe { assert_eq ! ( gl:: GetError ( ) , gl:: NO_ERROR ) ; }
526
+ unsafe { if cfg ! ( feature = "gldebug" ) { assert_eq ! ( gl:: GetError ( ) , gl:: NO_ERROR ) ; } }
527
527
528
528
let texture_2d_program = TextureProgram :: create_2d_program ( ) ;
529
529
let solid_color_program = SolidColorProgram :: new ( ) ;
@@ -542,14 +542,14 @@ impl RenderContext {
542
542
543
543
fn init_buffers ( ) -> Buffers {
544
544
let quad_vertex_buffer = gl:: gen_buffers ( 1 ) [ 0 ] ;
545
- unsafe { assert_eq ! ( gl:: GetError ( ) , gl:: NO_ERROR ) ; }
545
+ unsafe { if cfg ! ( feature = "gldebug" ) { assert_eq ! ( gl:: GetError ( ) , gl:: NO_ERROR ) ; } }
546
546
gl:: bind_buffer ( gl:: ARRAY_BUFFER , quad_vertex_buffer) ;
547
- unsafe { assert_eq ! ( gl:: GetError ( ) , gl:: NO_ERROR ) ; }
547
+ unsafe { if cfg ! ( feature = "gldebug" ) { assert_eq ! ( gl:: GetError ( ) , gl:: NO_ERROR ) ; } }
548
548
549
549
let line_quad_vertex_buffer = gl:: gen_buffers ( 1 ) [ 0 ] ;
550
- unsafe { assert_eq ! ( gl:: GetError ( ) , gl:: NO_ERROR ) ; }
550
+ unsafe { if cfg ! ( feature = "gldebug" ) { assert_eq ! ( gl:: GetError ( ) , gl:: NO_ERROR ) ; } }
551
551
gl:: bind_buffer ( gl:: ARRAY_BUFFER , line_quad_vertex_buffer) ;
552
- unsafe { assert_eq ! ( gl:: GetError ( ) , gl:: NO_ERROR ) ; }
552
+ unsafe { if cfg ! ( feature = "gldebug" ) { assert_eq ! ( gl:: GetError ( ) , gl:: NO_ERROR ) ; } }
553
553
554
554
Buffers {
555
555
quad_vertex_buffer : quad_vertex_buffer,
@@ -564,14 +564,14 @@ impl RenderContext {
564
564
color : & Color ) {
565
565
self . solid_color_program . enable_attribute_arrays ( ) ;
566
566
gl:: use_program ( self . solid_color_program . program . id ) ;
567
- unsafe { assert_eq ! ( gl:: GetError ( ) , gl:: NO_ERROR ) ; }
567
+ unsafe { if cfg ! ( feature = "gldebug" ) { assert_eq ! ( gl:: GetError ( ) , gl:: NO_ERROR ) ; } }
568
568
self . solid_color_program . bind_uniforms_and_attributes_for_quad ( vertices,
569
569
transform,
570
570
projection,
571
571
& self . buffers ,
572
572
color) ;
573
573
gl:: draw_arrays ( gl:: TRIANGLE_STRIP , 0 , 4 ) ;
574
- unsafe { assert_eq ! ( gl:: GetError ( ) , gl:: NO_ERROR ) ; }
574
+ unsafe { if cfg ! ( feature = "gldebug" ) { assert_eq ! ( gl:: GetError ( ) , gl:: NO_ERROR ) ; } }
575
575
self . solid_color_program . disable_attribute_arrays ( ) ;
576
576
}
577
577
@@ -595,21 +595,21 @@ impl RenderContext {
595
595
program. enable_attribute_arrays ( ) ;
596
596
597
597
gl:: use_program ( program. program . id ) ;
598
- unsafe { assert_eq ! ( gl:: GetError ( ) , gl:: NO_ERROR ) ; }
598
+ unsafe { if cfg ! ( feature = "gldebug" ) { assert_eq ! ( gl:: GetError ( ) , gl:: NO_ERROR ) ; } }
599
599
gl:: active_texture ( gl:: TEXTURE0 ) ;
600
- unsafe { assert_eq ! ( gl:: GetError ( ) , gl:: NO_ERROR ) ; }
600
+ unsafe { if cfg ! ( feature = "gldebug" ) { assert_eq ! ( gl:: GetError ( ) , gl:: NO_ERROR ) ; } }
601
601
gl:: bind_texture ( texture. target . as_gl_target ( ) , texture. native_texture ( ) ) ;
602
- unsafe { assert_eq ! ( gl:: GetError ( ) , gl:: NO_ERROR ) ; }
602
+ unsafe { if cfg ! ( feature = "gldebug" ) { assert_eq ! ( gl:: GetError ( ) , gl:: NO_ERROR ) ; } }
603
603
604
604
let filter_mode = if self . force_near_texture_filter {
605
605
gl:: NEAREST
606
606
} else {
607
607
gl:: LINEAR
608
608
} as GLint ;
609
609
gl:: tex_parameter_i ( texture. target . as_gl_target ( ) , gl:: TEXTURE_MAG_FILTER , filter_mode) ;
610
- unsafe { assert_eq ! ( gl:: GetError ( ) , gl:: NO_ERROR ) ; }
610
+ unsafe { if cfg ! ( feature = "gldebug" ) { assert_eq ! ( gl:: GetError ( ) , gl:: NO_ERROR ) ; } }
611
611
gl:: tex_parameter_i ( texture. target . as_gl_target ( ) , gl:: TEXTURE_MIN_FILTER , filter_mode) ;
612
- unsafe { assert_eq ! ( gl:: GetError ( ) , gl:: NO_ERROR ) ; }
612
+ unsafe { if cfg ! ( feature = "gldebug" ) { assert_eq ! ( gl:: GetError ( ) , gl:: NO_ERROR ) ; } }
613
613
614
614
// We calculate a transformation matrix for the texture coordinates
615
615
// which is useful for flipping the texture vertically or scaling the
@@ -636,12 +636,12 @@ impl RenderContext {
636
636
637
637
// Draw!
638
638
gl:: draw_arrays ( gl:: TRIANGLE_STRIP , 0 , 4 ) ;
639
- unsafe { assert_eq ! ( gl:: GetError ( ) , gl:: NO_ERROR ) ; }
639
+ unsafe { if cfg ! ( feature = "gldebug" ) { assert_eq ! ( gl:: GetError ( ) , gl:: NO_ERROR ) ; } }
640
640
gl:: bind_texture ( gl:: TEXTURE_2D , 0 ) ;
641
- unsafe { assert_eq ! ( gl:: GetError ( ) , gl:: NO_ERROR ) ; }
641
+ unsafe { if cfg ! ( feature = "gldebug" ) { assert_eq ! ( gl:: GetError ( ) , gl:: NO_ERROR ) ; } }
642
642
643
643
gl:: bind_texture ( texture. target . as_gl_target ( ) , 0 ) ;
644
- unsafe { assert_eq ! ( gl:: GetError ( ) , gl:: NO_ERROR ) ; }
644
+ unsafe { if cfg ! ( feature = "gldebug" ) { assert_eq ! ( gl:: GetError ( ) , gl:: NO_ERROR ) ; } }
645
645
program. disable_attribute_arrays ( )
646
646
}
647
647
@@ -659,9 +659,9 @@ impl RenderContext {
659
659
& self . buffers ,
660
660
color) ;
661
661
gl:: line_width ( line_thickness as GLfloat ) ;
662
- unsafe { assert_eq ! ( gl:: GetError ( ) , gl:: NO_ERROR ) ; }
662
+ unsafe { if cfg ! ( feature = "gldebug" ) { assert_eq ! ( gl:: GetError ( ) , gl:: NO_ERROR ) ; } }
663
663
gl:: draw_arrays ( gl:: LINE_STRIP , 0 , 5 ) ;
664
- unsafe { assert_eq ! ( gl:: GetError ( ) , gl:: NO_ERROR ) ; }
664
+ unsafe { if cfg ! ( feature = "gldebug" ) { assert_eq ! ( gl:: GetError ( ) , gl:: NO_ERROR ) ; } }
665
665
self . solid_color_program . disable_attribute_arrays ( ) ;
666
666
}
667
667
@@ -871,19 +871,19 @@ pub fn render_scene<T>(root_layer: Rc<Layer<T>>,
871
871
let v = scene. viewport . to_untyped ( ) ;
872
872
gl:: viewport ( v. origin . x as GLint , v. origin . y as GLint ,
873
873
v. size . width as GLsizei , v. size . height as GLsizei ) ;
874
- unsafe { assert_eq ! ( gl:: GetError ( ) , gl:: NO_ERROR ) ; }
874
+ unsafe { if cfg ! ( feature = "gldebug" ) { assert_eq ! ( gl:: GetError ( ) , gl:: NO_ERROR ) ; } }
875
875
876
876
// Enable depth testing for 3d transforms. Set z-mode to LESS-EQUAL
877
877
// so that layers with equal Z are able to paint correctly in
878
878
// the order they are specified.
879
879
gl:: enable ( gl:: DEPTH_TEST ) ;
880
- unsafe { assert_eq ! ( gl:: GetError ( ) , gl:: NO_ERROR ) ; }
880
+ unsafe { if cfg ! ( feature = "gldebug" ) { assert_eq ! ( gl:: GetError ( ) , gl:: NO_ERROR ) ; } }
881
881
gl:: clear_color ( 1.0 , 1.0 , 1.0 , 1.0 ) ;
882
- unsafe { assert_eq ! ( gl:: GetError ( ) , gl:: NO_ERROR ) ; }
882
+ unsafe { if cfg ! ( feature = "gldebug" ) { assert_eq ! ( gl:: GetError ( ) , gl:: NO_ERROR ) ; } }
883
883
gl:: clear ( gl:: COLOR_BUFFER_BIT | gl:: DEPTH_BUFFER_BIT ) ;
884
- unsafe { assert_eq ! ( gl:: GetError ( ) , gl:: NO_ERROR ) ; }
884
+ unsafe { if cfg ! ( feature = "gldebug" ) { assert_eq ! ( gl:: GetError ( ) , gl:: NO_ERROR ) ; } }
885
885
gl:: depth_func ( gl:: LEQUAL ) ;
886
- unsafe { assert_eq ! ( gl:: GetError ( ) , gl:: NO_ERROR ) ; }
886
+ unsafe { if cfg ! ( feature = "gldebug" ) { assert_eq ! ( gl:: GetError ( ) , gl:: NO_ERROR ) ; } }
887
887
888
888
// Set up the initial modelview matrix.
889
889
let transform = Matrix4 :: identity ( ) . scale ( scene. scale . get ( ) , scene. scale . get ( ) , 1.0 ) ;
0 commit comments