X-Git-Url: http://www2.svjatoslav.eu/gitweb/?p=sixth-3d.git;a=blobdiff_plain;f=src%2Fmain%2Fjava%2Feu%2Fsvjatoslav%2Fsixth%2Fe3d%2Fgui%2FView.java;h=bd604732ea09c142a882de153e94d54715a938a1;hp=ecd0e9d9b3c6b53b95da874b5767cbe1e85a9ce4;hb=c9cca2ea38fd301c4383d14178589c09520bea22;hpb=6213716671ccab6b7256de41838e1f5401ce173c diff --git a/src/main/java/eu/svjatoslav/sixth/e3d/gui/View.java b/src/main/java/eu/svjatoslav/sixth/e3d/gui/View.java index ecd0e9d..bd60473 100755 --- a/src/main/java/eu/svjatoslav/sixth/e3d/gui/View.java +++ b/src/main/java/eu/svjatoslav/sixth/e3d/gui/View.java @@ -1,10 +1,10 @@ /* - * Sixth - System for data storage, computation, exploration and interaction. - * Copyright ©2012-2016, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu - * + * Sixth 3D engine. Copyright ©2012-2018, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu + * * This program is free software; you can redistribute it and/or * modify it under the terms of version 3 of the GNU Lesser General Public License * or later as published by the Free Software Foundation. + * */ package eu.svjatoslav.sixth.e3d.gui; @@ -31,7 +31,7 @@ public class View extends JPanel implements ComponentListener { long lastUpdateMillis = 0; private Timer canvasUpdateTimer; private ViewUpdateTimerTask canvasUpdateTimerTask; - private RenderingContext renderingContext = new RenderingContext(1, 1, null); + private RenderingContext renderingContext = null; private MouseInteractionController currentMouseOverComponent; /** * Currently target FPS for this view. It might change at runtime. @@ -153,8 +153,7 @@ public class View extends JPanel implements ComponentListener { if ((renderingContext == null) || (renderingContext.width != getWidth()) || (renderingContext.height != getHeight())) - renderingContext = new RenderingContext(getWidth(), getHeight(), - renderingContext); + renderingContext = new RenderingContext(getWidth(), getHeight()); // clear drawing area { @@ -219,8 +218,10 @@ public class View extends JPanel implements ComponentListener { * graphics is needed. */ public void updateView() { - renderingContext.mouseClick = null; - renderingContext.clickedItem = null; + if (renderingContext != null){ + renderingContext.mouseClick = null; + renderingContext.clickedItem = null; + } // compute time passed since last view update final long currentTime = System.currentTimeMillis();