Skip to content

Fixes for DPI scaling. Mouse and select events now deliver GL surfac… #262

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jul 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added gluegen-java-src.zip
Binary file not shown.
Binary file modified gluegen-rt-natives-linux-amd64.jar
Binary file not shown.
Binary file modified gluegen-rt-natives-windows-amd64.jar
Binary file not shown.
Binary file modified gluegen-rt.jar
Binary file not shown.
Binary file added gluegen.jar
Binary file not shown.
Binary file modified jogl-all-natives-linux-amd64.jar
Binary file not shown.
Binary file modified jogl-all-natives-windows-amd64.jar
Binary file not shown.
Binary file modified jogl-all.jar
Binary file not shown.
Binary file added jogl-java-src.zip
Binary file not shown.
101 changes: 65 additions & 36 deletions src/gov/nasa/worldwind/AbstractSceneController.java
Original file line number Diff line number Diff line change
Expand Up @@ -75,15 +75,15 @@ public abstract class AbstractSceneController extends WWObjectImpl implements Sc
protected double frameTime;
protected double pickTime;
/**
* The pick point in AWT screen coordinates, or <code>null</code> if the pick point is disabled. Initially
* The pick point in GL surface screen coordinates, or <code>null</code> if the pick point is disabled. Initially
* <code>null</code>.
*/
protected Point pickPoint = null;
private Point pickPoint = null;
/**
* The pick rectangle in AWT screen coordinates, or <code>null</code> if the pick rectangle is disabled. Initially
* The pick rectangle in GL surface screen coordinates, or <code>null</code> if the pick rectangle is disabled. Initially
* <code>null</code>.
*/
protected Rectangle pickRect = null;
private Rectangle pickRect = null;
protected boolean deepPick = false;
protected GpuResourceCache gpuResourceCache;
protected TextRendererCache textRendererCache = new TextRendererCache();
Expand Down Expand Up @@ -111,15 +111,17 @@ public AbstractSceneController()
this.setVerticalExaggeration(Configuration.getDoubleValue(AVKey.VERTICAL_EXAGGERATION, 1d));
}

public void reinitialize()
@Override
public void reinitialize()
{
if (this.textRendererCache != null)
this.textRendererCache.dispose();
this.textRendererCache = new TextRendererCache();
}

/** Releases resources associated with this scene controller. */
public void dispose()
@Override
public void dispose()
{
if (this.lastPickedObjects != null)
this.lastPickedObjects.clear();
Expand All @@ -136,12 +138,14 @@ public void dispose()
this.textRendererCache.dispose();
}

public GpuResourceCache getGpuResourceCache()
@Override
public GpuResourceCache getGpuResourceCache()
{
return this.gpuResourceCache;
}

public void setGpuResourceCache(GpuResourceCache gpuResourceCache)
@Override
public void setGpuResourceCache(GpuResourceCache gpuResourceCache)
{
this.gpuResourceCache = gpuResourceCache;
}
Expand All @@ -151,17 +155,20 @@ public TextRendererCache getTextRendererCache()
return textRendererCache;
}

public Model getModel()
@Override
public Model getModel()
{
return this.model;
}

public View getView()
@Override
public View getView()
{
return this.view;
}

public void setModel(Model model)
@Override
public void setModel(Model model)
{
if (this.model != null)
this.model.removePropertyChangeListener(this);
Expand All @@ -173,7 +180,8 @@ public void setModel(Model model)
this.firePropertyChange(AVKey.MODEL, oldModel, model);
}

public void setView(View view)
@Override
public void setView(View view)
{
if (this.view != null)
this.view.removePropertyChangeListener(this);
Expand All @@ -186,44 +194,51 @@ public void setView(View view)
this.firePropertyChange(AVKey.VIEW, oldView, view);
}

public void setVerticalExaggeration(double verticalExaggeration)
@Override
public void setVerticalExaggeration(double verticalExaggeration)
{
Double oldVE = this.verticalExaggeration;
this.verticalExaggeration = verticalExaggeration;
this.firePropertyChange(AVKey.VERTICAL_EXAGGERATION, oldVE, verticalExaggeration);
}

public double getVerticalExaggeration()
@Override
public double getVerticalExaggeration()
{
return this.verticalExaggeration;
}

/** {@inheritDoc} */
public void setPickPoint(Point pickPoint)
@Override
public void setPickPoint(Point pickPoint)
{
this.pickPoint = pickPoint;
this.pickPoint = pickPoint;
}

/** {@inheritDoc} */
public Point getPickPoint()
@Override
public Point getPickPoint()
{
return this.pickPoint;
}

/** {@inheritDoc} */
public void setPickRectangle(Rectangle pickRect)
@Override
public void setPickRectangle(Rectangle pickRect)
{
this.pickRect = pickRect;
}

/** {@inheritDoc} */
public Rectangle getPickRectangle()
@Override
public Rectangle getPickRectangle()
{
return this.pickRect;
}

/** {@inheritDoc} */
public PickedObjectList getPickedObjectList()
@Override
public PickedObjectList getPickedObjectList()
{
return this.lastPickedObjects;
}
Expand All @@ -234,42 +249,50 @@ protected void setPickedObjectList(PickedObjectList pol)
}

/** {@inheritDoc} */
public PickedObjectList getObjectsInPickRectangle()
@Override
public PickedObjectList getObjectsInPickRectangle()
{
return this.lastObjectsInPickRect;
}

public void setDeepPickEnabled(boolean tf)
@Override
public void setDeepPickEnabled(boolean tf)
{
this.deepPick = tf;
}

public boolean isDeepPickEnabled()
@Override
public boolean isDeepPickEnabled()
{
return this.deepPick;
}

public SectorGeometryList getTerrain()
@Override
public SectorGeometryList getTerrain()
{
return this.dc.getSurfaceGeometry();
}

public DrawContext getDrawContext()
@Override
public DrawContext getDrawContext()
{
return this.dc;
}

public double getFramesPerSecond()
@Override
public double getFramesPerSecond()
{
return this.framesPerSecond;
}

public double getFrameTime()
@Override
public double getFrameTime()
{
return this.frameTime;
}

public void setPerFrameStatisticsKeys(Set<String> keys)
@Override
public void setPerFrameStatisticsKeys(Set<String> keys)
{
this.perFrameStatisticsKeys.clear();
if (keys == null)
Expand All @@ -282,34 +305,40 @@ public void setPerFrameStatisticsKeys(Set<String> keys)
}
}

public Collection<PerformanceStatistic> getPerFrameStatistics()
@Override
public Collection<PerformanceStatistic> getPerFrameStatistics()
{
return perFrameStatistics;
}

public Collection<Throwable> getRenderingExceptions()
@Override
public Collection<Throwable> getRenderingExceptions()
{
return this.renderingExceptions;
}

public ScreenCreditController getScreenCreditController()
@Override
public ScreenCreditController getScreenCreditController()
{
return screenCreditController;
}

public void setScreenCreditController(ScreenCreditController screenCreditController)
@Override
public void setScreenCreditController(ScreenCreditController screenCreditController)
{
this.screenCreditController = screenCreditController;
}

/** {@inheritDoc} */
public GLRuntimeCapabilities getGLRuntimeCapabilities()
@Override
public GLRuntimeCapabilities getGLRuntimeCapabilities()
{
return this.glRuntimeCaps;
}

/** {@inheritDoc} */
public void setGLRuntimeCapabilities(GLRuntimeCapabilities capabilities)
@Override
public void setGLRuntimeCapabilities(GLRuntimeCapabilities capabilities)
{
if (capabilities == null)
{
Expand Down Expand Up @@ -411,7 +440,8 @@ public void setDeferOrderedRendering(boolean deferOrderedRendering)
this.deferOrderedRendering = deferOrderedRendering;
}

public int repaint()
@Override
public int repaint()
{
this.frameTime = System.currentTimeMillis();

Expand Down Expand Up @@ -994,7 +1024,6 @@ protected void draw(DrawContext dc)
*
* @param dc the relevant <code>DrawContext</code>
*/
@SuppressWarnings({"UNUSED_SYMBOL", "UnusedDeclaration"})
protected void checkGLErrors(DrawContext dc)
{
GL gl = dc.getGL();
Expand Down
8 changes: 4 additions & 4 deletions src/gov/nasa/worldwind/SceneController.java
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ public interface SceneController extends WWObject, Disposable
double getFrameTime();

/**
* Specifies the current pick point in AWT screen coordinates, or <code>null</code> to indicate that there is no
* Specifies the current pick point in GL surface screen coordinates, or <code>null</code> to indicate that there is no
* pick point. Each frame, this scene controller determines which objects are drawn at the pick point and places
* them in a PickedObjectList. This list can be accessed by calling {@link #getPickedObjectList()}.
* <p>
Expand All @@ -140,7 +140,7 @@ public interface SceneController extends WWObject, Disposable
void setPickPoint(Point pickPoint);

/**
* Returns the current pick point in AWT screen coordinates.
* Returns the current pick point in GL surface coordinates.
*
* @return the current pick point, or <code>null</code> if no pick point is current.
*
Expand All @@ -149,7 +149,7 @@ public interface SceneController extends WWObject, Disposable
Point getPickPoint();

/**
* Specifies the current pick rectangle in AWT screen coordinates, or <code>null</code> to indicate that there is no
* Specifies the current pick rectangle in GL surface coordinates, or <code>null</code> to indicate that there is no
* pick rectangle. Each frame, this scene controller determines which objects intersect the pick rectangle and
* places them in a PickedObjectList. This list can be accessed by calling {@link #getObjectsInPickRectangle()}.
* <p>
Expand All @@ -161,7 +161,7 @@ public interface SceneController extends WWObject, Disposable
void setPickRectangle(Rectangle pickRect);

/**
* Returns the current pick rectangle in AWT screen coordinates.
* Returns the current pick rectangle in GL surface coordinates.
*
* @return the current pick rectangle, or <code>null</code> if no pick rectangle is current.
*
Expand Down
Loading