Interface GlyphRenderer

    • Method Detail

      • beginRendering

        void beginRendering​(com.jogamp.opengl.GL gl,
                            boolean ortho,
                            int width,
                            int height,
                            boolean disableDepthTest)
        Starts a render cycle with this GlyphRenderer.
        Parameters:
        gl - Current OpenGL context
        ortho - True if using orthographic projection
        width - Width of current OpenGL viewport
        height - Height of current OpenGL viewport
        disableDepthTest - True if should ignore depth values
        Throws:
        NullPointerException - if context is null
        IllegalArgumentException - if width or height is negative
        com.jogamp.opengl.GLException - if context is unexpected version
      • dispose

        void dispose​(com.jogamp.opengl.GL gl)
        Frees resources used by this GlyphRenderer.
        Parameters:
        gl - Current OpenGL context
        Throws:
        NullPointerException - if context is null
        com.jogamp.opengl.GLException - if context is unexpected version
      • drawGlyph

        float drawGlyph​(com.jogamp.opengl.GL gl,
                        Glyph glyph,
                        float x,
                        float y,
                        float z,
                        float scale,
                        com.jogamp.opengl.util.texture.TextureCoords coords)
        Draws a glyph with this GlyphRenderer.
        Parameters:
        gl - Current OpenGL context
        glyph - Visual representation of a character
        x - Position to draw on X axis, which may be negative
        y - Position to draw on Y axis, which may be negative
        z - Position to draw on Z axis, which may be negative
        scale - Relative size of glyph, which may be negative
        coords - Texture coordinates of glyph
        Returns:
        Distance to next character, which may be negative
        Throws:
        NullPointerException - if context, glyph, or texture coordinate is null
        com.jogamp.opengl.GLException - if context is unexpected version
      • endRendering

        void endRendering​(com.jogamp.opengl.GL gl)
        Finishes a render cycle with this GlyphRenderer.
        Parameters:
        gl - Current OpenGL context
        Throws:
        NullPointerException - if context is null
        com.jogamp.opengl.GLException - if context is unexpected version
      • flush

        void flush​(com.jogamp.opengl.GL gl)
        Forces all stored text to be rendered.
        Parameters:
        gl - Current OpenGL context
        Throws:
        NullPointerException - if context is null
        com.jogamp.opengl.GLException - if context is unexpected version
        IllegalStateException - if not in a render cycle
      • getUseVertexArrays

        boolean getUseVertexArrays()
        Checks if this GlyphRenderer is using vertex arrays.
        Returns:
        True if this renderer is using vertex arrays
      • setColor

        void setColor​(float r,
                      float g,
                      float b,
                      float a)
        Changes the color used to draw the text.
        Parameters:
        r - Red component of color
        g - Green component of color
        b - Blue component of color
        a - Alpha component of color
      • setTransform

        void setTransform​(float[] value,
                          boolean transpose)
        Changes the transformation matrix for drawing in 3D.
        Parameters:
        gl - Current OpenGL context
        value - Matrix as float array
        transpose - True if array is in in row-major order
        Throws:
        IndexOutOfBoundsException - if value's length is less than sixteen
        IllegalStateException - if in orthographic mode
      • setUseVertexArrays

        void setUseVertexArrays​(boolean useVertexArrays)
        Changes whether vertex arrays are in use.
        Parameters:
        useVertexArrays - true to use vertex arrays