From adaf8e215e6dfff3435d59867661b4cd8946569f Mon Sep 17 00:00:00 2001 From: Carsten Weisse Date: Sun, 2 Mar 2008 14:53:46 +0000 Subject: changes to handle resizable screens --- src/jake2/client/viddef_t.java | 41 +++++++++++++++++++++++++++++++++++++---- 1 file changed, 37 insertions(+), 4 deletions(-) diff --git a/src/jake2/client/viddef_t.java b/src/jake2/client/viddef_t.java index 56c92aa..5119841 100644 --- a/src/jake2/client/viddef_t.java +++ b/src/jake2/client/viddef_t.java @@ -16,13 +16,46 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ + */ // Created on 20.11.2003 by RST. -// $Id: viddef_t.java,v 1.1 2004-07-07 19:58:52 hzi Exp $ - package jake2.client; public class viddef_t { - public int width, height; + private int width; + private int height; + private int newWidth; + private int newHeight; + + /** + * This method doesn't affect width and height + * directly. The new values will be active after an update() + * call. + * + * @param width + * the visible render screen width. + * @param height + * the visible render screen height. + */ + public synchronized void setSize(int width, int height) { + newWidth = width; + newHeight = height; + } + + /** + * Updates the buffered width and height. The + * method should be called once at the beginning of a frame. + */ + public synchronized void update() { + width = newWidth; + height = newHeight; + } + + public int getWidth() { + return width; + } + + public int getHeight() { + return height; + } } -- cgit v1.2.3