Login  Register

Re: Force a GLCanvas size

Posted by Wade Walker on Feb 01, 2011; 3:36pm
URL: https://forum.jogamp.org/Force-a-GLCanvas-size-tp2393774p2397960.html

I see what you mean -- your requirement makes perfect sense now

Say you have a perfect client area size you want, pw x ph.

I would suggest creating your window with some small initial size (say iw x ih), then checking the client area size during window initialization (say it's cw x ch). At that point you know the window frame on the sides is of total width dw = (iw - cw), and on the top and bottom is of total height dh = (ih - ch). Then merely resize your window to size (pw + dw) x (ph + dh).

If you do this before your app draws anything, that should leave you with a client area of exactly pw x ph.