Class GLUgl2


  • public class GLUgl2
    extends GLU
    • Constructor Detail

      • GLUgl2

        public GLUgl2()
        Instantiates a new OpenGL Utility Library object. A GLU object may be instantiated at any point in the application and is not inherently tied to any particular OpenGL context; however, the GLU object may only be used when an OpenGL context is current on the current thread. Attempts to call most of the methods in the GLU library when no OpenGL context is current will cause an exception to be thrown.

        The returned GLU object is not guaranteed to be thread-safe and should only be used from one thread at a time. Multiple GLU objects may be instantiated to be used from different threads simultaneously.

    • Method Detail

      • isFunctionAvailable

        public final boolean isFunctionAvailable​(String gluFunctionName)
        Returns true if the specified GLU core- or extension-function can be successfully used through this GLU instance. By "successfully" we mean that the function is both callable on the machine running the program and available on the current display.

        A GLU function is callable if it is a GLU core- or extension-function that is supported by the underlying GLU implementation. The function is available if the OpenGL implementation on the display meets the requirements of the GLU function being called (because GLU functions utilize OpenGL functions).

        Whether or not a GLU function is callable is determined as follows:

        • If the function is a GLU core function (i.e., not an extension), gluGetString(GLU_VERSION) is used to determine the version number of the underlying GLU implementation on the host. then the function name is cross-referenced with that specification to see if it is part of that version's specification.
        • If the function is a GLU extension, the function name is cross-referenced with the list returned by gluGetString(GLU_EXTENSIONS) to see if the function is one of the extensions that is supported by the underlying GLU implementation.
        Whether or not a GLU function is available is determined as follows:
        • If the function is a GLU core function then the function is first cross-referenced with the GLU specifications to find the minimum GLU version required to call that GLU function. Then the following table is consulted to determine the minimum GL version required for that version of GLU:
          • GLU 1.0 requires OpenGL 1.0
          • GLU 1.1 requires OpenGL 1.0
          • GLU 1.2 requires OpenGL 1.1
          • GLU 1.3 requires OpenGL 1.2
          Finally, glGetString(GL_VERSION) is used to determine the highest OpenGL version that both host and display support, and from that it is possible to determine if the GL facilities required by the GLU function are available on the display.
        • If the function is a GLU extension, the function name is cross-referenced with the list returned by gluGetString(GLU_EXTENSIONS) to see if the function is one of the extensions that is supported by the underlying GLU implementation.
        NOTE:The availability of a function may change at runtime in response to changes in the display environment. For example, when a window is dragged from one display to another on a multi-display system, or when the properties of the display device are modified (e.g., changing the color depth of the display). Any application that is concerned with handling these situations correctly should confirm availability after a display change before calling a questionable OpenGL function. To detect a change in the display device, please see GLEventListener#displayChanged(GLAutoDrawable,boolean,boolean).
        Overrides:
        isFunctionAvailable in class GLU
        Parameters:
        gluFunctionName - the name of the OpenGL function (e.g., use "gluNurbsCallbackDataEXT" to check if the gluNurbsCallbackDataEXT(GLUnurbs, GLvoid) extension is available).
      • gluOrtho2D

        public final void gluOrtho2D​(float left,
                                     float right,
                                     float bottom,
                                     float top)
        Overrides:
        gluOrtho2D in class GLU
      • gluOrtho2D

        public final void gluOrtho2D​(double left,
                                     double right,
                                     double bottom,
                                     double top)
        Overrides:
        gluOrtho2D in class GLU
      • gluPerspective

        public final void gluPerspective​(float fovy,
                                         float aspect,
                                         float zNear,
                                         float zFar)
        Overrides:
        gluPerspective in class GLU
      • gluPerspective

        public final void gluPerspective​(double fovy,
                                         double aspect,
                                         double zNear,
                                         double zFar)
        Overrides:
        gluPerspective in class GLU
      • gluLookAt

        public final void gluLookAt​(float eyeX,
                                    float eyeY,
                                    float eyeZ,
                                    float centerX,
                                    float centerY,
                                    float centerZ,
                                    float upX,
                                    float upY,
                                    float upZ)
        Overrides:
        gluLookAt in class GLU
      • gluLookAt

        public final void gluLookAt​(double eyeX,
                                    double eyeY,
                                    double eyeZ,
                                    double centerX,
                                    double centerY,
                                    double centerZ,
                                    double upX,
                                    double upY,
                                    double upZ)
        Overrides:
        gluLookAt in class GLU
      • gluProject

        public final boolean gluProject​(double objX,
                                        double objY,
                                        double objZ,
                                        double[] model,
                                        int model_offset,
                                        double[] proj,
                                        int proj_offset,
                                        int[] view,
                                        int view_offset,
                                        double[] winPos,
                                        int winPos_offset)
        Interface to C language function:
        GLint gluProject(GLdouble objX, GLdouble objY, GLdouble objZ, const GLdouble * model, const GLdouble * proj, const GLint * view, GLdouble * winX, GLdouble * winY, GLdouble * winZ);

        Accepts the outgoing window coordinates as a single array.

        Overrides:
        gluProject in class GLU
      • gluProject

        public final boolean gluProject​(double objX,
                                        double objY,
                                        double objZ,
                                        DoubleBuffer model,
                                        DoubleBuffer proj,
                                        IntBuffer view,
                                        DoubleBuffer winPos)
        Interface to C language function:
        GLint gluProject(GLdouble objX, GLdouble objY, GLdouble objZ, const GLdouble * model, const GLdouble * proj, const GLint * view, GLdouble * winX, GLdouble * winY, GLdouble * winZ);

        Accepts the outgoing window coordinates as a single buffer.

      • gluUnProject

        public final boolean gluUnProject​(double winX,
                                          double winY,
                                          double winZ,
                                          double[] model,
                                          int model_offset,
                                          double[] proj,
                                          int proj_offset,
                                          int[] view,
                                          int view_offset,
                                          double[] objPos,
                                          int objPos_offset)
        Interface to C language function:
        GLint gluUnProject(GLdouble winX, GLdouble winY, GLdouble winZ, const GLdouble * model, const GLdouble * proj, const GLint * view, GLdouble * objX, GLdouble * objY, GLdouble * objZ);

        Accepts the outgoing object coordinates (a 3-vector) as a single array.

        Overrides:
        gluUnProject in class GLU
      • gluUnProject

        public final boolean gluUnProject​(double winX,
                                          double winY,
                                          double winZ,
                                          DoubleBuffer model,
                                          DoubleBuffer proj,
                                          IntBuffer view,
                                          DoubleBuffer objPos)
        Interface to C language function:
        GLint gluUnProject(GLdouble winX, GLdouble winY, GLdouble winZ, const GLdouble * model, const GLdouble * proj, const GLint * view, GLdouble * objX, GLdouble * objY, GLdouble * objZ);

        Accepts the outgoing object coordinates (a 3-vector) as a single buffer.

      • gluUnProject4

        public final boolean gluUnProject4​(double winX,
                                           double winY,
                                           double winZ,
                                           double clipW,
                                           double[] model,
                                           int model_offset,
                                           double[] proj,
                                           int proj_offset,
                                           int[] view,
                                           int view_offset,
                                           double nearVal,
                                           double farVal,
                                           double[] objPos,
                                           int objPos_offset)
        Interface to C language function:
        GLint gluUnProject4(GLdouble winX, GLdouble winY, GLdouble winZ, GLdouble clipW, const GLdouble * model, const GLdouble * proj, const GLint * view, GLdouble nearVal, GLdouble farVal, GLdouble * objX, GLdouble * objY, GLdouble * objZ, GLdouble * objW);

        Accepts the outgoing object coordinates (a 4-vector) as a single array.

        Overrides:
        gluUnProject4 in class GLU
      • gluUnProject4

        public final boolean gluUnProject4​(double winX,
                                           double winY,
                                           double winZ,
                                           double clipW,
                                           DoubleBuffer model,
                                           DoubleBuffer proj,
                                           IntBuffer view,
                                           double nearVal,
                                           double farVal,
                                           DoubleBuffer objPos)
        Interface to C language function:
        GLint gluUnProject4(GLdouble winX, GLdouble winY, GLdouble winZ, GLdouble clipW, const GLdouble * model, const GLdouble * proj, const GLint * view, GLdouble nearVal, GLdouble farVal, GLdouble * objX, GLdouble * objY, GLdouble * objZ, GLdouble * objW);

        Accepts the outgoing object coordinates (a 4-vector) as a single buffer.

      • gluPickMatrix

        public final void gluPickMatrix​(double x,
                                        double y,
                                        double delX,
                                        double delY,
                                        int[] viewport,
                                        int viewport_offset)
        Overrides:
        gluPickMatrix in class GLU
      • gluPickMatrix

        public final void gluPickMatrix​(double x,
                                        double y,
                                        double delX,
                                        double delY,
                                        IntBuffer viewport)
        Overrides:
        gluPickMatrix in class GLU
      • gluBuild1DMipmapLevels

        public final int gluBuild1DMipmapLevels​(int target,
                                                int internalFormat,
                                                int width,
                                                int format,
                                                int type,
                                                int level,
                                                int base,
                                                int max,
                                                Buffer data)
        Interface to C language function:
        GLint gluBuild1DMipmapLevels(GLenum target, GLint internalFormat, GLsizei width, GLenum format, GLenum type, GLint level, GLint base, GLint max, const void * data);
        Overrides:
        gluBuild1DMipmapLevels in class GLU
      • gluBuild1DMipmaps

        public final int gluBuild1DMipmaps​(int target,
                                           int internalFormat,
                                           int width,
                                           int format,
                                           int type,
                                           Buffer data)
        Interface to C language function:
        GLint gluBuild1DMipmaps(GLenum target, GLint internalFormat, GLsizei width, GLenum format, GLenum type, const void * data);
        Overrides:
        gluBuild1DMipmaps in class GLU
      • gluBuild2DMipmapLevels

        public final int gluBuild2DMipmapLevels​(int target,
                                                int internalFormat,
                                                int width,
                                                int height,
                                                int format,
                                                int type,
                                                int level,
                                                int base,
                                                int max,
                                                Buffer data)
        Interface to C language function:
        GLint gluBuild2DMipmapLevels(GLenum target, GLint internalFormat, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint level, GLint base, GLint max, const void * data);
        Overrides:
        gluBuild2DMipmapLevels in class GLU
      • gluBuild2DMipmaps

        public final int gluBuild2DMipmaps​(int target,
                                           int internalFormat,
                                           int width,
                                           int height,
                                           int format,
                                           int type,
                                           Buffer data)
        Interface to C language function:
        GLint gluBuild2DMipmaps(GLenum target, GLint internalFormat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void * data);
        Overrides:
        gluBuild2DMipmaps in class GLU
      • gluBuild3DMipmapLevels

        public final int gluBuild3DMipmapLevels​(int target,
                                                int internalFormat,
                                                int width,
                                                int height,
                                                int depth,
                                                int format,
                                                int type,
                                                int level,
                                                int base,
                                                int max,
                                                Buffer data)
        Interface to C language function:
        GLint gluBuild3DMipmapLevels(GLenum target, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLint level, GLint base, GLint max, const void * data);
        Overrides:
        gluBuild3DMipmapLevels in class GLU
      • gluBuild3DMipmaps

        public final int gluBuild3DMipmaps​(int target,
                                           int internalFormat,
                                           int width,
                                           int height,
                                           int depth,
                                           int format,
                                           int type,
                                           Buffer data)
        Interface to C language function:
        GLint gluBuild3DMipmaps(GLenum target, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void * data);
        Overrides:
        gluBuild3DMipmaps in class GLU
      • gluScaleImage

        public final int gluScaleImage​(int format,
                                       int wIn,
                                       int hIn,
                                       int typeIn,
                                       Buffer dataIn,
                                       int wOut,
                                       int hOut,
                                       int typeOut,
                                       Buffer dataOut)
        Interface to C language function:
        GLint gluScaleImage(GLenum format, GLsizei wIn, GLsizei hIn, GLenum typeIn, const void * dataIn, GLsizei wOut, GLsizei hOut, GLenum typeOut, GLvoid * dataOut);
        Overrides:
        gluScaleImage in class GLU
      • gluNurbsProperty

        public final void gluNurbsProperty​(GLUnurbs r,
                                           int property,
                                           float value)
        Sets a property on a NURBS object. (NOTE: this function is not currently implemented.)
        Parameters:
        r - GLUnurbs object holding NURBS to which a property should be set
        property - property id
        value - property value
      • gluNewNurbsRenderer

        public final GLUnurbs gluNewNurbsRenderer()
        Creates a new GLUnurbs object.
        Returns:
        GLUnurbs object
      • gluBeginCurve

        public final void gluBeginCurve​(GLUnurbs r)
        Begins a curve definition.
        Parameters:
        r - GLUnurbs object to specify curve to
      • gluBeginSurface

        public final void gluBeginSurface​(GLUnurbs r)
        Begins a surface definition.
        Parameters:
        r - GLUnurbs object to specify surface to
      • gluEndSurface

        public final void gluEndSurface​(GLUnurbs r)
        Ends a surface.
        Parameters:
        r - GLUnurbs object holding surface
      • gluNurbsSurface

        public final void gluNurbsSurface​(GLUnurbs r,
                                          int sknot_count,
                                          float[] sknot,
                                          int tknot_count,
                                          float[] tknot,
                                          int s_stride,
                                          int t_stride,
                                          float[] ctlarray,
                                          int sorder,
                                          int torder,
                                          int type)
        Makes a NURBS surface.
        Parameters:
        r - GLUnurbs object holding the surface
        sknot_count - number of knots in s direction
        sknot - knots in s direction
        tknot_count - number of knots in t direction
        tknot - knots in t direction
        s_stride - number of control points coordinates in s direction
        t_stride - number of control points coordinates in t direction
        ctlarray - control points
        sorder - order of surface in s direction
        torder - order of surface in t direction
        type - surface type
      • gluNurbsCurve

        public final void gluNurbsCurve​(GLUnurbs r,
                                        int nknots,
                                        float[] knot,
                                        int stride,
                                        float[] ctlarray,
                                        int order,
                                        int type)
        Make a NURBS curve.
        Parameters:
        r - GLUnurbs object holding the curve
        nknots - number of knots
        knot - knot vector
        stride - number of control point coordinates
        ctlarray - control points
        order - order of the curve
        type - curve type
      • gluEndCurve

        public final void gluEndCurve​(GLUnurbs r)
        Ends a curve definition.
        Parameters:
        r - GLUnurbs object holding the curve