Package jgl.wt.awt

Class GL

    • Field Detail

      • renderedOnce

        protected boolean renderedOnce
    • Constructor Detail

      • GL

        public GL()
    • Method Detail

      • glXSwapBuffers

        public void glXSwapBuffers​(Graphics g,
                                   ImageObserver o)
        Draws the image buffer that was built by glFlush() with the caller Graphics context OpenGL equivalent: void glXSwapBuffers (Display *dpy, GLXDrawable drawable)
      • glXSwapBuffers

        public void glXSwapBuffers​(Graphics g,
                                   Applet o)
      • glFlush

        public void glFlush()
        Description copied from class: GL
        Creates a new ImageType based on the current color buffer.
        Specified by:
        glFlush in class GL<BufferedImage,​Font>
      • applyViewport

        public void applyViewport()
        Description copied from class: GL
        Apply viewport according to the latest known expected width/height and the latest known pixel scales.
        Overrides:
        applyViewport in class GL<BufferedImage,​Font>
      • glXMakeCurrent

        public boolean glXMakeCurrent​(Component o,
                                      int x,
                                      int y)
        Bool glXMakeCurrent (Display *dpy, GLXDrawable drawable, GLXcontext ctx)
      • glJGetComponent

        public Component glJGetComponent()
      • updatePixelScale

        public void updatePixelScale​(Graphics g)
      • getPixelScaleFromG2D

        protected void getPixelScaleFromG2D​(Graphics2D g2d)
        Pixel scale is used to model the pixel ratio introduced by HiDPI
      • getPixelScaleX

        protected double getPixelScaleX​(AffineTransform globalTransform)
      • getPixelScaleY

        protected double getPixelScaleY​(AffineTransform globalTransform)
      • printGlobalScale

        protected void printGlobalScale​(Graphics2D g2d)
      • configureRenderingHints

        protected void configureRenderingHints​(Graphics2D g2d)
      • hackClearColorWithG2DfillRect

        protected void hackClearColorWithG2DfillRect​(Graphics2D g2d)
      • glIntToColor

        public static Color glIntToColor​(int color)
        Convert a color given as an integer to an AWT Color.
      • getClearColorAWT

        public Color getClearColorAWT()
        Returns:
        the clear color as an AWT Color.
      • drawImagesAndClearBuffer

        protected void drawImagesAndClearBuffer​(Graphics2D g2d)
      • drawTexts

        protected void drawTexts​(Graphics2D g2d)
        Renders appended text to given Graphics2D context.
        Parameters:
        g2d -
      • preRotateFromLeftPoint

        protected void preRotateFromLeftPoint​(Graphics2D g2d,
                                              int x,
                                              int y,
                                              float rotate,
                                              int textWidth)
        Configure graphics to rotate text and shift the text horizontally
      • postRotateFromLeftPoint

        protected void postRotateFromLeftPoint​(Graphics2D g2d,
                                               int x,
                                               int y,
                                               float rotate,
                                               int textWidth)
        Apply reverse rotation and translation to reset graphics context.