JSoftware
03-08-2005, 03:40 PM
well as i have just spend 2 weeks of hard work coding a somewhat functioning pbuffer class i found out that ATi had finally given me the opportunity to utilize FrameBuffer Object Magic in my opengl apps.!
this information got me a little angry but i start out reading the spec. But! i can't get it working. For some reason it just renders white to my texture! :shock:
Here's the simple code:
glgenframebuffersext(1, @f);
glbindframebufferext(gl_framebuffer_ext, f);
glgenrenderbuffersext(1, @r);
glbindrenderbufferext(gl_renderbuffer_ext, r);
glrenderbufferstorageext(gl_renderbuffer_ext, gl_depth_component24, 512, 512);
glgentextures(1, @tex);
glbindtexture(gl_texture_2d, tex);
glteximage2d(gl_texture_2d, 0,gl_rgb,512,512,0,gl_rgb,gl_int, nil);
glframebuffertexture2dext(gl_framebuffer_ext, gl_color_attachment0_ext, gl_texture_2d, tex, 0);
glFramebufferRenderbufferEXT(gl_framebuffer_ext, gl_depth_attachment_ext, gl_renderbuffer_ext, r);
Can anybody get this to draw something on the screen?!? (I haven't included render code here as it should be obvious from the above..)
EDIT: Forgot the two gltexparameteri calls after the texture :oops:
this information got me a little angry but i start out reading the spec. But! i can't get it working. For some reason it just renders white to my texture! :shock:
Here's the simple code:
glgenframebuffersext(1, @f);
glbindframebufferext(gl_framebuffer_ext, f);
glgenrenderbuffersext(1, @r);
glbindrenderbufferext(gl_renderbuffer_ext, r);
glrenderbufferstorageext(gl_renderbuffer_ext, gl_depth_component24, 512, 512);
glgentextures(1, @tex);
glbindtexture(gl_texture_2d, tex);
glteximage2d(gl_texture_2d, 0,gl_rgb,512,512,0,gl_rgb,gl_int, nil);
glframebuffertexture2dext(gl_framebuffer_ext, gl_color_attachment0_ext, gl_texture_2d, tex, 0);
glFramebufferRenderbufferEXT(gl_framebuffer_ext, gl_depth_attachment_ext, gl_renderbuffer_ext, r);
Can anybody get this to draw something on the screen?!? (I haven't included render code here as it should be obvious from the above..)
EDIT: Forgot the two gltexparameteri calls after the texture :oops: