Class NativePainterFactory

    • Field Detail

      • capabilities

        protected com.jogamp.opengl.GLCapabilities capabilities
      • offscreen

        protected boolean offscreen
      • width

        protected int width
      • height

        protected int height
      • traceGL

        protected boolean traceGL
      • debugGL

        protected boolean debugGL
    • Constructor Detail

      • NativePainterFactory

        public NativePainterFactory()
        Initialize a factory with a default desired GLCapabilities defined by getDefaultCapabilities(GLProfile) based on the detected GLProfile, either GLProfile.GL2 or GLProfile.GL2ES2 if GLProfile.GL2 is not available. If none of these profile is available, an UnsupportedOperationException is thrown.
      • NativePainterFactory

        public NativePainterFactory​(com.jogamp.opengl.GLCapabilities capabilities)
    • Method Detail

      • getCapabilities

        public com.jogamp.opengl.GLCapabilities getCapabilities()
        Return desired Open GL Capabilities
      • setOffscreen

        public void setOffscreen​(int width,
                                 int height)
        Set the painter factory with the offscreen image dimension will configure Capabilities.setOnscreen(boolean) properly and let inheriting painters they should use OffscreenCanvas instead of the ICanvas they use by default for display.
        Specified by:
        setOffscreen in interface IPainterFactory
      • detectGLProfile

        public static com.jogamp.opengl.GLProfile detectGLProfile()
        OPENGL PROFILE AND CAPABILITIES HELPERS
      • getOffscreenCapabilities

        public static com.jogamp.opengl.GLCapabilities getOffscreenCapabilities​(com.jogamp.opengl.GLProfile glp)
        This profile has prove to fix the fact that using a raw GLCapabilities without settings let screenshot as gray only
      • getDefaultCapabilities

        public static com.jogamp.opengl.GLCapabilities getDefaultCapabilities​(com.jogamp.opengl.GLProfile glp)
      • isTraceGL

        public boolean isTraceGL()
      • setTraceGL

        public void setTraceGL​(boolean traceGL)
        If true, will enable GL code tracing in console. Default is false. This is equivalent to enabling the JVM flag -Djogl.debug.TraceGLGL
      • setDebugGL

        public void setDebugGL​(boolean debugGL)
        If true, will let GL trigger GLException if an error occur in OpenGL which ease debugging. Default is false. This is equivalent to enabling the JVM flag -Djogl.debug.DebugGL
        Specified by:
        setDebugGL in interface IPainterFactory