Login  Register

Re: Getting GLAutoDrawable from GL4

Posted by siddharth.cmdz on Nov 26, 2014; 12:03am
URL: https://forum.jogamp.org/Getting-GLAutoDrawable-from-GL4-tp4033629p4033635.html

thanks , its just that my view which is basically a GLEventListener is passed GLAutoDrawable. When i want my View to render using framebuffer object, I have GL4 at that point.

Basically I have a "Drawable" that takes in a View, render to an FBO and uses the texture from the FBO for to texture a quad that the Drawable renders. Call it "RenderToTextureDrawable". The Drawable(s) in my case have draw(GL4..) method (as well as other methods like init(GL4 ..), dispose(GL4..) etc )that takes in a GL instance. So its a matter of function signature. And as the View (Which is a GLEventListener) takes in a GLAutoDrawable in its init(..) method, I was wondering if i could get the GLAutoDrawable from GL instance since the drawable needs to init, draw the fbo view.

PS.. this isnt production code, just something for me to experiment with. I stored the instance of the GLAutoDrawable as you mentioned and everything works, however like you mentioned, I would like to refactor that. Since this is just educational, I dont want to use scenegraphs.

I might be reinventing the wheel here because I think I saw APIs for fbos within the GLAutoDrawable (I might be mistaken here).. but thats ok by me ..since this is experimental and learning the APIs.