Class ViewportJOGL

  • All Implemented Interfaces:
    IViewport

    public class ViewportJOGL
    extends AbstractViewport
    OpenGL/JOGL-based Viewport. This viewport attempts to use OpenGL for drawing. Exceptions/Errors may be thrown if OpenGL cannot be linked, also be sure to test isValid() afterwards to verify the availability of necessary extensions.
    • Constructor Detail

      • ViewportJOGL

        public ViewportJOGL​(IPerspective persp,
                            java.lang.ClassLoader classloader)
        Creates a new OpenGL-based viewport. May throw UnsatisfiedLinkError and RuntimeException if linking to OpenGL fails.
        Parameters:
        layerObject - object holding properties for pre/postlayers
        libService - library service for loading resources.
    • Method Detail

      • refresh

        public void refresh()
        Description copied from interface: IViewport
        Refreshes the viewport.
      • isValid

        public boolean isValid()
        Verifies the OpenGL context is valid and useable.
      • getTexture

        public int getTexture​(javax.media.opengl.GL gl,
                              java.lang.String path)
        Returns a texture.
        Parameters:
        gl - OpenGL interface
        path - resource path of the texture
        Returns:
        the texture
      • getTextRenderer

        public com.sun.opengl.util.j2d.TextRenderer getTextRenderer​(java.awt.Font font)
        Returns an appropriate text renderer.
        Parameters:
        font - the font for the renderer
        Returns:
        the renderer
      • getDisplayList

        public java.lang.Integer getDisplayList​(java.lang.String listName)
        Returns a previous generated display list or null if it doesn't exist
        Parameters:
        listName - name of the list
        Returns:
        previously generated display list
      • setDisplayList

        public void setDisplayList​(java.lang.String listName,
                                   java.lang.Integer list)
        Sets a display list.
        Parameters:
        listName - name of the list
        list - the display list
      • getContext

        public javax.media.opengl.GL getContext()
        Returns the current GL rendering context.
        Returns:
        GL context, null if none is available
      • drawPrimitive

        public void drawPrimitive​(DrawableCombiner dc,
                                  Primitive primitive,
                                  java.lang.Object obj)
        Draws a primitive
        Parameters:
        dc - The combiner.
        primitive - The primitive.
        obj - The object being drawn.
      • dispose

        public void dispose()
        Disposes the Viewport.