Class NativeDesktopPainter

    • Field Detail

      • gl

        protected com.jogamp.opengl.GL gl
      • glu

        protected com.jogamp.opengl.glu.GLU glu
      • glut

        protected com.jogamp.opengl.util.gl2.GLUT glut
    • Constructor Detail

      • NativeDesktopPainter

        public NativeDesktopPainter()
    • Method Detail

      • getGL

        public com.jogamp.opengl.GL getGL()
      • setGL

        public void setGL​(com.jogamp.opengl.GL gl)
      • getGLU

        public com.jogamp.opengl.glu.GLU getGLU()
      • setGLU

        public void setGLU​(com.jogamp.opengl.glu.GLU glu)
      • getGLUT

        public com.jogamp.opengl.util.gl2.GLUT getGLUT()
      • setGLUT

        public void setGLUT​(com.jogamp.opengl.util.gl2.GLUT glut)
      • acquireGL

        public Object acquireGL()
        Description copied from interface: IPainter
        In the context of a multithreaded application, this method allows retrieving the GL context for the calling thread. Once work is done the caller should call IPainter.releaseGL()
        Specified by:
        acquireGL in interface IPainter
      • releaseGL

        public void releaseGL()
        Description copied from interface: IPainter
        In the context of a multithreaded application, this method allows releasing the GL context by the calling thread to let other thread use it. IPainter.acquireGL()
        Specified by:
        releaseGL in interface IPainter
      • getCurrentGL

        public com.jogamp.opengl.GL getCurrentGL​(ICanvas canvas)
        Get the current GL context of the canvas and make it current. This is usefull when needing to get a GL instance outside of the context of the GLEventListener, e.g. when clicking the frame with mouse.
      • getCurrentContext

        public com.jogamp.opengl.GLContext getCurrentContext​(ICanvas canvas)
      • configureGL

        public void configureGL​(Quality quality)
        Description copied from interface: IPainter
        Apply quality settings as OpenGL commands
        Specified by:
        configureGL in interface IPainter
      • glPushMatrix

        public void glPushMatrix()
        OPEN GL Interface
        Specified by:
        glPushMatrix in interface IPainter
      • glMatrixMode

        public void glMatrixMode​(int mode)
        Specified by:
        glMatrixMode in interface IPainter
      • glScalef

        public void glScalef​(float x,
                             float y,
                             float z)
        Specified by:
        glScalef in interface IPainter
      • glTranslatef

        public void glTranslatef​(float x,
                                 float y,
                                 float z)
        Specified by:
        glTranslatef in interface IPainter
      • glRotatef

        public void glRotatef​(float angle,
                              float x,
                              float y,
                              float z)
        Specified by:
        glRotatef in interface IPainter
      • glEnable

        public void glEnable​(int type)
        Specified by:
        glEnable in interface IPainter
      • glDisable

        public void glDisable​(int type)
        Specified by:
        glDisable in interface IPainter
      • glPointSize

        public void glPointSize​(float width)
        Specified by:
        glPointSize in interface IPainter
      • glLineWidth

        public void glLineWidth​(float width)
        Specified by:
        glLineWidth in interface IPainter
      • glBegin

        public void glBegin​(int type)
        Specified by:
        glBegin in interface IPainter
      • glColor3f

        public void glColor3f​(float r,
                              float g,
                              float b)
        Specified by:
        glColor3f in interface IPainter
      • glColor4f

        public void glColor4f​(float r,
                              float g,
                              float b,
                              float a)
        Specified by:
        glColor4f in interface IPainter
      • glVertex3f

        public void glVertex3f​(float x,
                               float y,
                               float z)
        Specified by:
        glVertex3f in interface IPainter
      • glVertex3d

        public void glVertex3d​(double x,
                               double y,
                               double z)
        Specified by:
        glVertex3d in interface IPainter
      • glEnd

        public void glEnd()
        Specified by:
        glEnd in interface IPainter
      • glFrontFace

        public void glFrontFace​(int mode)
        Specified by:
        glFrontFace in interface IPainter
      • glCullFace

        public void glCullFace​(int mode)
        Specified by:
        glCullFace in interface IPainter
      • polygonModeValue

        protected int polygonModeValue​(PolygonMode mode)
      • polygonFillValue

        protected int polygonFillValue​(PolygonFill mode)
      • glPolygonMode

        public void glPolygonMode​(int frontOrBack,
                                  int fill)
        Specified by:
        glPolygonMode in interface IPainter
      • glPolygonOffset

        public void glPolygonOffset​(float factor,
                                    float units)
        Specified by:
        glPolygonOffset in interface IPainter
      • glLineStipple

        public void glLineStipple​(int factor,
                                  short pattern)
        Specified by:
        glLineStipple in interface IPainter
      • glTexCoord2f

        public void glTexCoord2f​(float s,
                                 float t)
        Specified by:
        glTexCoord2f in interface IPainter
      • glTexEnvf

        public void glTexEnvf​(int target,
                              int pname,
                              float param)
        Specified by:
        glTexEnvf in interface IPainter
      • glTexEnvi

        public void glTexEnvi​(int target,
                              int pname,
                              int param)
        Specified by:
        glTexEnvi in interface IPainter
      • glRasterPos3f

        public void glRasterPos3f​(float x,
                                  float y,
                                  float z)
        Specified by:
        glRasterPos3f in interface IPainter
      • glDrawPixels

        public void glDrawPixels​(int width,
                                 int height,
                                 int format,
                                 int type,
                                 Buffer pixels)
        Specified by:
        glDrawPixels in interface IPainter
      • glPixelZoom

        public void glPixelZoom​(float xfactor,
                                float yfactor)
        Specified by:
        glPixelZoom in interface IPainter
      • glPixelStorei

        public void glPixelStorei​(int pname,
                                  int param)
        Specified by:
        glPixelStorei in interface IPainter
      • glBitmap

        public void glBitmap​(int width,
                             int height,
                             float xorig,
                             float yorig,
                             float xmove,
                             float ymove,
                             byte[] bitmap,
                             int bitmap_offset)
        Specified by:
        glBitmap in interface IPainter
      • drawImage

        public void drawImage​(ByteBuffer imageBuffer,
                              int imageWidth,
                              int imageHeight,
                              Coord2d pixelZoom,
                              Coord3d imagePosition)
        Description copied from interface: IPainter
        A high level and easy way of drawing images (non OpenGL).
        Specified by:
        drawImage in interface IPainter
      • drawText

        public void drawText​(Font font,
                             String label,
                             Coord3d position,
                             Color color,
                             float rotation)
        Description copied from interface: IPainter
        A high level and easy way of drawing texts (non OpenGL). Rotation may not be supported by all IPainter
        Specified by:
        drawText in interface IPainter
      • glGenLists

        public int glGenLists​(int range)
        Specified by:
        glGenLists in interface IPainter
      • glNewList

        public void glNewList​(int list,
                              int mode)
        Specified by:
        glNewList in interface IPainter
      • glEndList

        public void glEndList()
        Specified by:
        glEndList in interface IPainter
      • glCallList

        public void glCallList​(int list)
        Specified by:
        glCallList in interface IPainter
      • glIsList

        public boolean glIsList​(int list)
        Specified by:
        glIsList in interface IPainter
      • glDeleteLists

        public void glDeleteLists​(int list,
                                  int range)
        Specified by:
        glDeleteLists in interface IPainter
      • gluDisk

        public void gluDisk​(double inner,
                            double outer,
                            int slices,
                            int loops)
        Specified by:
        gluDisk in interface IPainter
      • glutSolidSphere

        public void glutSolidSphere​(double radius,
                                    int slices,
                                    int stacks)
        Specified by:
        glutSolidSphere in interface IPainter
      • gluSphere

        public void gluSphere​(double radius,
                              int slices,
                              int stacks)
        Specified by:
        gluSphere in interface IPainter
      • gluCylinder

        public void gluCylinder​(double base,
                                double top,
                                double height,
                                int slices,
                                int stacks)
        Specified by:
        gluCylinder in interface IPainter
      • glutSolidCube

        public void glutSolidCube​(float size)
        Specified by:
        glutSolidCube in interface IPainter
      • glRenderMode

        public int glRenderMode​(int mode)
        Specified by:
        glRenderMode in interface IPainter
      • glPassThrough

        public void glPassThrough​(float token)
        Specified by:
        glPassThrough in interface IPainter
      • glOrtho

        public void glOrtho​(double left,
                            double right,
                            double bottom,
                            double top,
                            double near_val,
                            double far_val)
        Specified by:
        glOrtho in interface IPainter
      • gluPerspective

        public void gluPerspective​(double fovy,
                                   double aspect,
                                   double zNear,
                                   double zFar)
        Specified by:
        gluPerspective in interface IPainter
      • glFrustum

        public void glFrustum​(double left,
                              double right,
                              double bottom,
                              double top,
                              double zNear,
                              double zFar)
        Specified by:
        glFrustum in interface IPainter
      • gluLookAt

        public void gluLookAt​(float eyeX,
                              float eyeY,
                              float eyeZ,
                              float centerX,
                              float centerY,
                              float centerZ,
                              float upX,
                              float upY,
                              float upZ)
        Specified by:
        gluLookAt in interface IPainter
      • glViewport

        public void glViewport​(int x,
                               int y,
                               int width,
                               int height)
        Specified by:
        glViewport in interface IPainter
      • gluUnProject

        public boolean gluUnProject​(float winX,
                                    float winY,
                                    float winZ,
                                    float[] model,
                                    int model_offset,
                                    float[] proj,
                                    int proj_offset,
                                    int[] view,
                                    int view_offset,
                                    float[] objPos,
                                    int objPos_offset)
        Specified by:
        gluUnProject in interface IPainter
      • gluProject

        public boolean gluProject​(float objX,
                                  float objY,
                                  float objZ,
                                  float[] model,
                                  int model_offset,
                                  float[] proj,
                                  int proj_offset,
                                  int[] view,
                                  int view_offset,
                                  float[] winPos,
                                  int winPos_offset)
        Specified by:
        gluProject in interface IPainter
      • glGetIntegerv

        public void glGetIntegerv​(int pname,
                                  int[] data,
                                  int data_offset)
        Specified by:
        glGetIntegerv in interface IPainter
      • glGetDoublev

        public void glGetDoublev​(int pname,
                                 double[] params,
                                 int params_offset)
        Specified by:
        glGetDoublev in interface IPainter
      • glGetFloatv

        public void glGetFloatv​(int pname,
                                float[] data,
                                int data_offset)
        Specified by:
        glGetFloatv in interface IPainter
      • glDepthFunc

        public void glDepthFunc​(int func)
        Specified by:
        glDepthFunc in interface IPainter
      • glDepthRangef

        public void glDepthRangef​(float near,
                                  float far)
        Specified by:
        glDepthRangef in interface IPainter
      • glBlendFunc

        public void glBlendFunc​(int sfactor,
                                int dfactor)
        Specified by:
        glBlendFunc in interface IPainter
      • glHint

        public void glHint​(int target,
                           int mode)
        Specified by:
        glHint in interface IPainter
      • glShadeModel

        public void glShadeModel​(int mode)
        Specified by:
        glShadeModel in interface IPainter
      • glMaterialfv

        public void glMaterialfv​(int face,
                                 int pname,
                                 float[] params,
                                 int params_offset)
        Specified by:
        glMaterialfv in interface IPainter
      • glNormal3f

        public void glNormal3f​(float nx,
                               float ny,
                               float nz)
        Specified by:
        glNormal3f in interface IPainter
      • glLightModeli

        public void glLightModeli​(int mode,
                                  int value)
        Specified by:
        glLightModeli in interface IPainter
      • glLightfv

        public void glLightfv​(int light,
                              int pname,
                              float[] params,
                              int params_offset)
        Specified by:
        glLightfv in interface IPainter
      • glLight_Position

        public void glLight_Position​(int lightId,
                                     float[] positionZero)
        Specified by:
        glLight_Position in interface IPainter
      • glEnable_Light

        public void glEnable_Light​(int light)
        Specified by:
        glEnable_Light in interface IPainter
      • glDisable_Light

        public void glDisable_Light​(int light)
        Specified by:
        glDisable_Light in interface IPainter
      • lightId

        protected int lightId​(int id)
      • glClearColor

        public void glClearColor​(float red,
                                 float green,
                                 float blue,
                                 float alpha)
        Specified by:
        glClearColor in interface IPainter
      • glClearDepth

        public void glClearDepth​(double d)
        Specified by:
        glClearDepth in interface IPainter
      • glClear

        public void glClear​(int mask)
        Specified by:
        glClear in interface IPainter
      • glLoadName

        public void glLoadName​(int name)
        Specified by:
        glLoadName in interface IPainter
      • glPushName

        public void glPushName​(int name)
        Specified by:
        glPushName in interface IPainter
      • glPopName

        public void glPopName()
        Specified by:
        glPopName in interface IPainter
      • gluPickMatrix

        public void gluPickMatrix​(double x,
                                  double y,
                                  double delX,
                                  double delY,
                                  int[] viewport,
                                  int viewport_offset)
        Specified by:
        gluPickMatrix in interface IPainter
      • glFlush

        public void glFlush()
        Specified by:
        glFlush in interface IPainter
      • glEvalCoord2f

        public void glEvalCoord2f​(float u,
                                  float v)
        Specified by:
        glEvalCoord2f in interface IPainter
      • glMap2f

        public void glMap2f​(int target,
                            float u1,
                            float u2,
                            int ustride,
                            int uorder,
                            float v1,
                            float v2,
                            int vstride,
                            int vorder,
                            FloatBuffer points)
        Specified by:
        glMap2f in interface IPainter
      • materialProperty

        protected int materialProperty​(MaterialProperty material)