Class JoGLCanvas

  • All Implemented Interfaces:
    com.jogamp.opengl.GLEventListener, java.util.EventListener, Canvas

    public final class JoGLCanvas
    extends java.lang.Object
    implements Canvas, com.jogamp.opengl.GLEventListener
    JoGL implementation of a Canvas.
    Author:
    Pierre Lando
    • Method Detail

      • setDebugMode

        public void setDebugMode​(boolean debug)
      • setMainDrawer

        public void setMainDrawer​(Drawer mainDrawer)
        Description copied from interface: Canvas
        Set this canvas main drawer.
        Specified by:
        setMainDrawer in interface Canvas
        Parameters:
        mainDrawer - the new canvas main drawer.
      • getMainDrawer

        public Drawer getMainDrawer()
        Description copied from interface: Canvas
        Return the canvas main drawer.
        Specified by:
        getMainDrawer in interface Canvas
        Returns:
        the canvas main drawer.
      • getBuffersManager

        public JoGLBuffersManager getBuffersManager()
        Description copied from interface: Canvas
        Return the buffers manager of this canvas.
        Specified by:
        getBuffersManager in interface Canvas
        Returns:
        the buffers manager of this canvas.
      • getPickingManager

        public PickingManager getPickingManager()
        Description copied from interface: Canvas
        Return the picking manager.
        Specified by:
        getPickingManager in interface Canvas
        Returns:
        the picking manager.
      • getWidth

        public int getWidth()
        Description copied from interface: Canvas
        Return the canvas width.
        Specified by:
        getWidth in interface Canvas
        Returns:
        the canvas width.
      • getHeight

        public int getHeight()
        Description copied from interface: Canvas
        Return the canvas height.
        Specified by:
        getHeight in interface Canvas
        Returns:
        the canvas height.
      • getDimension

        public java.awt.Dimension getDimension()
        Description copied from interface: Canvas
        Return the canvas dimension.
        Specified by:
        getDimension in interface Canvas
        Returns:
        the canvas dimension.
      • redraw

        public void redraw()
        Description copied from interface: Canvas
        Ask the canvas to perform asynchronous drawing.
        Specified by:
        redraw in interface Canvas
      • redrawAndWait

        public void redrawAndWait()
        Description copied from interface: Canvas
        Ask the canvas to perform asynchronous drawing.
        Specified by:
        redrawAndWait in interface Canvas
      • waitImage

        public void waitImage()
        Description copied from interface: Canvas
        Wait until a drawing has been performed
        Specified by:
        waitImage in interface Canvas
      • getAntiAliasingLevel

        public int getAntiAliasingLevel()
        Description copied from interface: Canvas
        Anti-aliasing level getter. - 0 for 1x - 1 for 2x - 2 for 4x - 3 for 8x - 4 for 16x
        Specified by:
        getAntiAliasingLevel in interface Canvas
        Returns:
        the anti-aliasing level.
      • setAntiAliasingLevel

        public void setAntiAliasingLevel​(int antiAliasingLevel)
        Description copied from interface: Canvas
        Anti-aliasing level setter. - 0 for 1x - 1 for 2x - 2 for 4x - 3 for 8x - 4 for 16x
        Specified by:
        setAntiAliasingLevel in interface Canvas
        Parameters:
        antiAliasingLevel - the new level.
      • getGl

        public com.jogamp.opengl.GL2 getGl()
        Return the OpenGl context.
        Returns:
        the OpenGl context.
      • getJoGLParameters

        public JoGLParameters getJoGLParameters()
        Return the rendering parameters.
        Returns:
        the rendering parameters.
      • getImage

        public java.awt.image.BufferedImage getImage()
        Get an image from the autoDrawable
        Returns:
        an image
      • destroy

        public void destroy()
        Destroy the GLPbuffer
        Specified by:
        destroy in interface Canvas
      • display

        public void display​(com.jogamp.opengl.GLAutoDrawable glAutoDrawable)
        Specified by:
        display in interface com.jogamp.opengl.GLEventListener
      • init

        public void init​(com.jogamp.opengl.GLAutoDrawable glAutoDrawable)
        Specified by:
        init in interface com.jogamp.opengl.GLEventListener
      • reshape

        public void reshape​(com.jogamp.opengl.GLAutoDrawable glAutoDrawable,
                            int x,
                            int y,
                            int width,
                            int height)
        Specified by:
        reshape in interface com.jogamp.opengl.GLEventListener
      • dispose

        public void dispose​(com.jogamp.opengl.GLAutoDrawable drawable)
        Specified by:
        dispose in interface com.jogamp.opengl.GLEventListener