What's the relation between GLCanvas.setsize , JFrame.setsize , JFrame.getLocationOnScreen , and gl.glViewport?
This post was updated on .
Are they referring to the same size beginning at the same left corner coordinate and the same width and height ?
Is glViewport automatically called when the window is resized ?
What should I do to prevent jogl from automatically stretching my screen after resizing? I'd like to have it to show part of my screen or blackness which is not rendered when I'm resizing and moving the window .
And , if I have blackness outside the rendered area after resizing the window , what should I do to stretch the screen to fit the blackness ? This is the problem I'm facing when messing around offscreen rendering where I'm trying to set glViewport larger than the GLcanvas ( which is also the size of JFrame ). In my case the output image fills the exceeded area with blackness while my stuff are placed at a corner . But , isn't glViewport remapping NDC to framebuffer ? How could you even be possible to render only part of the viewport ? My explanation is that , since I'm calling glviewport in init . There might be another glviewport is called from another place which overrode my call of glviewport .
Thanks all your replies
Re: What's the relation between GLCanvas.setsize , JFrame.setsize , JFrame.getLocationOnScreen , and gl.glViewport?
Hi . Yes , after testing my codes , I found that before display is called and after init is over , there's a call to reshape which will automatically set glviewport to the size of the window . Yes , they're independent things .
Another question : When I'm using glviewport , as well as printing a and b value received in reshape method , why the x,y coordinates are always 0 ? Won't the left bottom corner change when I'm moving the window ?