1
1
use std:: sync:: mpsc:: Receiver ;
2
2
use std:: sync:: Arc ;
3
3
4
- use glfw:: { Context , Glfw , Window , WindowEvent } ;
4
+ use glfw:: { fail_on_errors , Context , Glfw , GlfwReceiver , PWindow , Window , WindowEvent } ;
5
5
6
6
use glow:: HasContext ;
7
7
use librashader_common:: { GetSize , Size , Viewport } ;
@@ -14,13 +14,13 @@ const TITLE: &str = "librashader OpenGL 3.3";
14
14
15
15
pub fn setup ( ) -> (
16
16
Glfw ,
17
- Window ,
18
- Receiver < ( f64 , WindowEvent ) > ,
17
+ PWindow ,
18
+ GlfwReceiver < ( f64 , WindowEvent ) > ,
19
19
glow:: Program ,
20
20
glow:: VertexArray ,
21
21
Arc < glow:: Context > ,
22
22
) {
23
- let mut glfw = glfw:: init ( glfw :: FAIL_ON_ERRORS ) . unwrap ( ) ;
23
+ let mut glfw = glfw:: init ( fail_on_errors ! ( ) ) . unwrap ( ) ;
24
24
glfw. window_hint ( glfw:: WindowHint :: ContextVersion ( 3 , 3 ) ) ;
25
25
glfw. window_hint ( glfw:: WindowHint :: OpenGlProfile (
26
26
glfw:: OpenGlProfileHint :: Core ,
@@ -171,8 +171,8 @@ void main()
171
171
pub fn do_loop (
172
172
gl : & Arc < glow:: Context > ,
173
173
mut glfw : Glfw ,
174
- mut window : Window ,
175
- events : Receiver < ( f64 , WindowEvent ) > ,
174
+ mut window : PWindow ,
175
+ events : GlfwReceiver < ( f64 , WindowEvent ) > ,
176
176
triangle_program : glow:: Program ,
177
177
triangle_vao : glow:: VertexArray ,
178
178
filter : & mut FilterChainGL ,
@@ -183,7 +183,7 @@ pub fn do_loop(
183
183
let quad_vbuf;
184
184
185
185
let output_texture;
186
- let output_framebuffer_handle;
186
+ // let output_framebuffer_handle;
187
187
let output_quad_vbuf;
188
188
189
189
unsafe {
@@ -270,10 +270,11 @@ pub fn do_loop(
270
270
}
271
271
272
272
unsafe {
273
+ gl. bind_framebuffer ( glow:: FRAMEBUFFER , None ) ;
273
274
// do frmaebuffer
274
- output_framebuffer_handle = gl. create_framebuffer ( ) . unwrap ( ) ;
275
-
276
- gl. bind_framebuffer ( glow:: FRAMEBUFFER , Some ( output_framebuffer_handle) ) ;
275
+ // output_framebuffer_handle = gl.create_framebuffer().unwrap();
276
+ //
277
+ // gl.bind_framebuffer(glow::FRAMEBUFFER, Some(output_framebuffer_handle));
277
278
278
279
// glow::ObjectLabel(
279
280
// glow::FRAMEBUFFER,
@@ -324,18 +325,18 @@ pub fn do_loop(
324
325
) ;
325
326
326
327
// set color attachment
327
- gl. framebuffer_texture_2d (
328
- glow:: FRAMEBUFFER ,
329
- glow:: COLOR_ATTACHMENT0 ,
330
- glow:: TEXTURE_2D ,
331
- Some ( output_texture) ,
332
- 0 ,
333
- ) ;
328
+ // gl.framebuffer_texture_2d(
329
+ // glow::FRAMEBUFFER,
330
+ // glow::COLOR_ATTACHMENT0,
331
+ // glow::TEXTURE_2D,
332
+ // Some(output_texture),
333
+ // 0,
334
+ // );
334
335
335
- gl. draw_buffer ( glow:: COLOR_ATTACHMENT0 ) ;
336
- if gl. check_framebuffer_status ( glow:: FRAMEBUFFER ) != glow:: FRAMEBUFFER_COMPLETE {
337
- panic ! ( "failed to create fbo" )
338
- }
336
+ // gl.draw_buffer(glow::COLOR_ATTACHMENT0);
337
+ // if gl.check_framebuffer_status(glow::FRAMEBUFFER) != glow::FRAMEBUFFER_COMPLETE {
338
+ // panic!("failed to create fbo")
339
+ // }
339
340
340
341
let fullscreen_fbo = [
341
342
-1.0f32 , -1.0 , 0.0 , 1.0 , -1.0 , 0.0 , -1.0 , 1.0 , 0.0 , -1.0 , 1.0 , 0.0 , 1.0 , -1.0 , 0.0 ,
0 commit comments