Class PSurfaceJOGL

java.lang.Object
processing.opengl.PSurfaceJOGL
All Implemented Interfaces:
PSurface

public class PSurfaceJOGL extends Object implements PSurface
  • Field Details

    • profile

      public static com.jogamp.opengl.GLProfile profile
      Selected GL profile
    • pgl

      public PJOGL pgl
    • window

      protected com.jogamp.newt.opengl.GLWindow window
    • animator

      protected com.jogamp.opengl.util.FPSAnimator animator
    • screenRect

      protected Rectangle screenRect
    • sketch

      protected PApplet sketch
    • graphics

      protected PGraphics graphics
    • sketchWidthRequested

      protected int sketchWidthRequested
    • sketchHeightRequested

      protected int sketchHeightRequested
    • sketchWidth

      protected int sketchWidth
    • sketchHeight

      protected int sketchHeight
    • display

      protected com.jogamp.newt.Display display
    • screen

      protected com.jogamp.newt.Screen screen
    • displayRect

      protected Rectangle displayRect
    • drawException

      protected Throwable drawException
    • canvas

      protected com.jogamp.newt.awt.NewtCanvasAWT canvas
    • sharedDrawable

      protected static com.jogamp.opengl.GLAutoDrawable sharedDrawable
    • animators

      protected static ArrayList<com.jogamp.opengl.util.FPSAnimator> animators
    • windowScaleFactor

      protected int windowScaleFactor
    • currentPixelScale

      protected float[] currentPixelScale
  • Constructor Details

    • PSurfaceJOGL

      public PSurfaceJOGL(PGraphics graphics)
  • Method Details

    • initOffscreen

      public void initOffscreen(PApplet sketch)
      Specified by:
      initOffscreen in interface PSurface
    • initFrame

      public void initFrame(PApplet sketch)
      Specified by:
      initFrame in interface PSurface
    • getNative

      public Object getNative()
      Description copied from interface: PSurface
      Get the native window object associated with this drawing surface. For Java2D, this will be an AWT Frame object. For OpenGL, the window. The data returned here is subject to the whims of the renderer, and using this method means you're willing to deal with underlying implementation changes and that you won't throw a fit like a toddler if your code breaks sometime in the future.
      Specified by:
      getNative in interface PSurface
    • initDisplay

      protected void initDisplay()
    • getDisplayBounds

      protected static Rectangle getDisplayBounds(int displayNum)
    • initGL

      protected void initGL()
    • initWindow

      protected void initWindow()
    • initListeners

      protected void initListeners()
    • initAnimator

      protected void initAnimator()
    • setTitle

      public void setTitle(String title)
      Description copied from interface: PSurface
      Set the window (and dock, or whatever necessary) title.
      Specified by:
      setTitle in interface PSurface
    • setVisible

      public void setVisible(boolean visible)
      Description copied from interface: PSurface
      Show or hide the window.
      Specified by:
      setVisible in interface PSurface
    • setResizable

      public void setResizable(boolean resizable)
      Description copied from interface: PSurface
      Set true if we want to resize things (default is not resizable)
      Specified by:
      setResizable in interface PSurface
    • setIcon

      public void setIcon(PImage icon)
      Specified by:
      setIcon in interface PSurface
    • setAlwaysOnTop

      public void setAlwaysOnTop(boolean always)
      Description copied from interface: PSurface
      Dumb name, but inherited from Frame and no better ideas.
      Specified by:
      setAlwaysOnTop in interface PSurface
    • initIcons

      protected void initIcons()
    • placeWindow

      public void placeWindow(int[] location, int[] editorLocation)
      Specified by:
      placeWindow in interface PSurface
    • placePresent

      public void placePresent(int stopColor)
      Specified by:
      placePresent in interface PSurface
    • startThread

      public void startThread()
      Description copied from interface: PSurface
      Start the animation thread
      Specified by:
      startThread in interface PSurface
    • pauseThread

      public void pauseThread()
      Description copied from interface: PSurface
      On the next trip through the animation thread, things should go sleepy-bye. Does not pause the thread immediately because that needs to happen on the animation thread itself, so fires on the next trip through draw().
      Specified by:
      pauseThread in interface PSurface
    • resumeThread

      public void resumeThread()
      Specified by:
      resumeThread in interface PSurface
    • stopThread

      public boolean stopThread()
      Description copied from interface: PSurface
      Stop the animation thread (set it null)
      Specified by:
      stopThread in interface PSurface
      Returns:
      false if already stopped
    • isStopped

      public boolean isStopped()
      Specified by:
      isStopped in interface PSurface
    • setLocation

      public void setLocation(int x, int y)
      Specified by:
      setLocation in interface PSurface
    • setSize

      public void setSize(int wide, int high)
      Specified by:
      setSize in interface PSurface
    • getPixelScale

      public float getPixelScale()
    • getCurrentPixelScale

      protected float getCurrentPixelScale()
    • getComponent

      public Component getComponent()
    • setSmooth

      public void setSmooth(int level)
    • setFrameRate

      public void setFrameRate(float fps)
      Specified by:
      setFrameRate in interface PSurface
    • requestFocus

      public void requestFocus()
    • nativeMouseEvent

      protected void nativeMouseEvent(com.jogamp.newt.event.MouseEvent nativeEvent, int peAction)
    • nativeKeyEvent

      protected void nativeKeyEvent(com.jogamp.newt.event.KeyEvent nativeEvent, int peAction)
    • setCursor

      public void setCursor(int kind)
      Specified by:
      setCursor in interface PSurface
    • setCursor

      public void setCursor(PImage image, int hotspotX, int hotspotY)
      Specified by:
      setCursor in interface PSurface
    • showCursor

      public void showCursor()
      Specified by:
      showCursor in interface PSurface
    • hideCursor

      public void hideCursor()
      Specified by:
      hideCursor in interface PSurface
    • loadImage

      public PImage loadImage(String path, Object... args)
      Specified by:
      loadImage in interface PSurface
    • openLink

      public boolean openLink(String url)
      Specified by:
      openLink in interface PSurface
      Parameters:
      url - the link to open
      Returns:
      false if unable to find a viable way to open
    • selectInput

      public void selectInput(String prompt, String callbackMethod, File file, Object callbackObject)
      Specified by:
      selectInput in interface PSurface
    • selectOutput

      public void selectOutput(String prompt, String callbackMethod, File file, Object callbackObject)
      Specified by:
      selectOutput in interface PSurface
    • selectFolder

      public void selectFolder(String prompt, String callbackMethod, File file, Object callbackObject)
      Specified by:
      selectFolder in interface PSurface