Class IOSGraphics

java.lang.Object
arc.Graphics
arc.backend.robovm.IOSGraphics
All Implemented Interfaces:
Disposable

public class IOSGraphics extends Graphics
  • Constructor Details

  • Method Details

    • resume

      public void resume()
    • pause

      public void pause()
    • draw

      public void draw(org.robovm.apple.glkit.GLKView view, org.robovm.apple.coregraphics.CGRect rect)
    • update

      public void update(org.robovm.apple.glkit.GLKViewController controller)
    • updateSafeInsets

      protected void updateSafeInsets()
    • willPause

      public void willPause(org.robovm.apple.glkit.GLKViewController controller, boolean pause)
    • getSafeInsets

      public int[] getSafeInsets()
      Overrides:
      getSafeInsets in class Graphics
      Returns:
      the safe area insets, in the order left-right-top-bottom.
    • getGL20

      public GL20 getGL20()
      Specified by:
      getGL20 in class Graphics
      Returns:
      the GL20 instance
    • setGL20

      public void setGL20(GL20 gl20)
      Description copied from class: Graphics
      Set the GL20 instance
      Specified by:
      setGL20 in class Graphics
    • isGL30Available

      public boolean isGL30Available()
      Description copied from class: Graphics
      Returns whether OpenGL ES 3.0 is available. If it is you can get an instance of GL30 via Graphics.getGL30() to access OpenGL ES 3.0 functionality. Note that this functionality will only be available if you instructed the Application instance to use OpenGL ES 3.0!
      Overrides:
      isGL30Available in class Graphics
      Returns:
      whether OpenGL ES 3.0 is available
    • getGL30

      public GL30 getGL30()
      Specified by:
      getGL30 in class Graphics
      Returns:
      the GL30 instance or null if not supported
    • setGL30

      public void setGL30(GL30 gl30)
      Description copied from class: Graphics
      Set the GL30 instance
      Specified by:
      setGL30 in class Graphics
    • getWidth

      public int getWidth()
      Specified by:
      getWidth in class Graphics
      Returns:
      the width of the client area in logical pixels.
    • getHeight

      public int getHeight()
      Specified by:
      getHeight in class Graphics
      Returns:
      the height of the client area in logical pixels
    • getBackBufferWidth

      public int getBackBufferWidth()
      Specified by:
      getBackBufferWidth in class Graphics
      Returns:
      the width of the framebuffer in physical pixels
    • getBackBufferHeight

      public int getBackBufferHeight()
      Specified by:
      getBackBufferHeight in class Graphics
      Returns:
      the height of the framebuffer in physical pixels
    • getDeltaTime

      public float getDeltaTime()
      Specified by:
      getDeltaTime in class Graphics
      Returns:
      the time span between the current frame and the last frame in seconds. Might be smoothed over n frames.
    • getFramesPerSecond

      public int getFramesPerSecond()
      Specified by:
      getFramesPerSecond in class Graphics
      Returns:
      the average number of frames per second
    • getGLVersion

      public GLVersion getGLVersion()
      Specified by:
      getGLVersion in class Graphics
      Returns:
      the GLVersion of this Graphics instance
    • getPpiX

      public float getPpiX()
      Specified by:
      getPpiX in class Graphics
      Returns:
      the pixels per inch on the x-axis
    • getPpiY

      public float getPpiY()
      Specified by:
      getPpiY in class Graphics
      Returns:
      the pixels per inch on the y-axis
    • getPpcX

      public float getPpcX()
      Specified by:
      getPpcX in class Graphics
      Returns:
      the pixels per centimeter on the x-axis
    • getPpcY

      public float getPpcY()
      Specified by:
      getPpcY in class Graphics
      Returns:
      the pixels per centimeter on the y-axis.
    • getDensity

      public float getDensity()
      Description copied from class: Graphics
      This is a scaling factor for the Density Independent Pixel unit, following the same conventions as android.util.DisplayMetrics#density, where one DIP is one pixel on an approximately 160 dpi screen. Thus on a 160dpi screen this density value will be 1; on a 120 dpi screen it would be .75; etc.
      Specified by:
      getDensity in class Graphics
      Returns:
      the logical density of the Display.
    • setWindowedMode

      public boolean setWindowedMode(int width, int height)
      Description copied from class: Graphics
      Sets the window to windowed mode.
      Specified by:
      setWindowedMode in class Graphics
      Parameters:
      width - the width in pixels
      height - the height in pixels
      Returns:
      whether the operation succeeded
    • setTitle

      public void setTitle(String title)
      Description copied from class: Graphics
      Sets the title of the window. Ignored on Android.
      Specified by:
      setTitle in class Graphics
      Parameters:
      title - the title.
    • setBorderless

      public void setBorderless(boolean undecorated)
      Description copied from class: Graphics
      Sets the window decoration as enabled or disabled. On Android, this will enable/disable the menu bar.

      Note that immediate behavior of this method may vary depending on the implementation. It may be necessary for the window to be recreated in order for the changes to take effect. Consult the documentation for the backend in use for more information.

      Supported on all desktop backends and on Android (to disable the menu bar).

      Specified by:
      setBorderless in class Graphics
      Parameters:
      undecorated - true if the window border or status bar should be hidden. false otherwise.
    • setResizable

      public void setResizable(boolean resizable)
      Description copied from class: Graphics
      Sets whether or not the window should be resizable. Ignored on Android.

      Note that immediate behavior of this method may vary depending on the implementation. It may be necessary for the window to be recreated in order for the changes to take effect. Consult the documentation for the backend in use for more information.

      Supported on all desktop backends.

      Specified by:
      setResizable in class Graphics
    • setVSync

      public void setVSync(boolean vsync)
      Description copied from class: Graphics
      Enable/Disable vsynching. This is a best-effort attempt which might not work on all platforms.
      Specified by:
      setVSync in class Graphics
      Parameters:
      vsync - vsync enabled or not.
    • getBufferFormat

      public Graphics.BufferFormat getBufferFormat()
      Specified by:
      getBufferFormat in class Graphics
      Returns:
      the format of the color, depth and stencil buffer in a Graphics.BufferFormat instance
    • supportsExtension

      public boolean supportsExtension(String extension)
      Specified by:
      supportsExtension in class Graphics
      Parameters:
      extension - the extension name
      Returns:
      whether the extension is supported
    • isContinuousRendering

      public boolean isContinuousRendering()
      Specified by:
      isContinuousRendering in class Graphics
      Returns:
      whether rendering is continuous.
    • setContinuousRendering

      public void setContinuousRendering(boolean isContinuous)
      Description copied from class: Graphics
      Sets whether to render continuously. In case rendering is performed non-continuously, the following events will trigger a redraw:
      • A call to Graphics.requestRendering()
      • Input events from the touch screen/mouse or keyboard
      • A Runnable is posted to the rendering thread via Application.post(Runnable). In the case of a multi-window app, all windows will request rendering if a runnable is posted to the application. To avoid this, post a runnable to the window instead.

      Life-cycle events will also be reported as usual, see ApplicationListener. This method can be called from any thread.

      Specified by:
      setContinuousRendering in class Graphics
      Parameters:
      isContinuous - whether the rendering should be continuous or not.
    • requestRendering

      public void requestRendering()
      Description copied from class: Graphics
      Requests a new frame to be rendered if the rendering mode is non-continuous. This method can be called from any thread.
      Specified by:
      requestRendering in class Graphics
    • isFullscreen

      public boolean isFullscreen()
      Description copied from class: Graphics
      Whether the app is fullscreen or not
      Specified by:
      isFullscreen in class Graphics
    • getFrameId

      public long getFrameId()
      Description copied from class: Graphics
      Returns the id of the current frame. The general contract of this method is that the id is incremented only when the application is in the running state right before calling the ApplicationListener.update() method. Also, the id of the first frame is 0; the id of subsequent frames is guaranteed to take increasing values for 263-1 rendering cycles.
      Specified by:
      getFrameId in class Graphics
      Returns:
      the id of the current frame
    • newCursor

      public Graphics.Cursor newCursor(Pixmap pixmap, int xHotspot, int yHotspot)
      Description copied from class: Graphics
      Create a new cursor represented by the Pixmap. The Pixmap must be in RGBA8888 format, width & height must be powers-of-two greater than zero (not necessarily equal) and of a certain minimum size (32x32 is a safe bet), and alpha transparency must be single-bit (i.e., 0x00 or 0xFF only). This function returns a Cursor object that can be set as the system cursor by calling Graphics.setCursor(Cursor) .
      Specified by:
      newCursor in class Graphics
      Parameters:
      pixmap - the mouse cursor image as a Pixmap
      xHotspot - the x location of the hotspot pixel within the cursor image (origin top-left corner)
      yHotspot - the y location of the hotspot pixel within the cursor image (origin top-left corner)
      Returns:
      a cursor object that can be used by calling Graphics.setCursor(Cursor) or null if not supported
    • setCursor

      public void setCursor(Graphics.Cursor cursor)
      Description copied from class: Graphics
      Only viable on desktop and web. Browsers that support cursor:url() and support the png format (the pixmap is converted to a data-url of type image/png) should also support custom cursors. Will set the mouse cursor image to the image represented by the Graphics.Cursor. It is recommended to call this function in the main render thread, and maximum one time per frame. Internal use only!
      Specified by:
      setCursor in class Graphics
      Parameters:
      cursor - the mouse cursor as a Graphics.Cursor
    • setSystemCursor

      public void setSystemCursor(Graphics.Cursor.SystemCursor systemCursor)
      Description copied from class: Graphics
      Sets one of the predefined Graphics.Cursor.SystemCursors. Internal use only!
      Specified by:
      setSystemCursor in class Graphics