Package com.metsci.glimpse.core.context
Interface GlimpseContext
-
- All Known Implementing Classes:
GlimpseContextImpl
,WrappedGlimpseContext
public interface GlimpseContext
GlimpseContext wraps aGLContext
and provides additional contextual information necessary to display aGlimpsePainter
.- Author:
- ulman
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description int
getDPI()
com.jogamp.opengl.GL
getGL()
com.jogamp.opengl.GLContext
getGLContext()
float[]
getSurfaceScale()
Returns the scale factors needed to convert the _native_ pixel coordinates to the _window_ pixel coordinates.GlimpseTargetStack
getTargetStack()
TheGlimpseTargetStack
stack contains the chain of nestedGlimpseTarget
s starting at the top levelGlimpseTarget
(index 0) and ending at the GlimpseTarget currently being painted to.
-
-
-
Method Detail
-
getGLContext
com.jogamp.opengl.GLContext getGLContext()
- Returns:
- a reference to the OpenGL rendering context wrapped by this GlimpseContext
-
getGL
com.jogamp.opengl.GL getGL()
- Returns:
- a convenience method shorthand for the common:
getGLContext( )
.getGL( )
-
getTargetStack
GlimpseTargetStack getTargetStack()
TheGlimpseTargetStack
stack contains the chain of nestedGlimpseTarget
s starting at the top levelGlimpseTarget
(index 0) and ending at the GlimpseTarget currently being painted to.The top level GlimpseTarget is always an instance of GlimpseCanvas. The other levels are instances of
GlimpseLayout
.
-
getDPI
int getDPI()
- Returns:
- the ratio of pixels per inch for the current context
-
getSurfaceScale
float[] getSurfaceScale()
Returns the scale factors needed to convert the _native_ pixel coordinates to the _window_ pixel coordinates. This only really matters on displays like like Macbook Retina.- Returns:
- the scale factors as {scaleX, scaleY}
-
-