Class NanoVGGL3

java.lang.Object
org.lwjgl.nanovg.NanoVGGL3

public class NanoVGGL3 extends Object
Implementation of the NanoVG API using OpenGL 3.0.
  • Field Details

    • NVG_ANTIALIAS

      public static final int NVG_ANTIALIAS
      Create flags.
      Enum values:
      • ANTIALIAS - Flag indicating if geometry based anti-aliasing is used (may not be needed when using MSAA).
      • STENCIL_STROKES - Flag indicating if strokes should be drawn using stencil buffer. The rendering will be a little slower, but path overlaps (i.e. self-intersecting or sharp turns) will be drawn just once.
      • DEBUG - Flag indicating that additional debug checks are done.
      See Also:
    • NVG_STENCIL_STROKES

      public static final int NVG_STENCIL_STROKES
      Create flags.
      Enum values:
      • ANTIALIAS - Flag indicating if geometry based anti-aliasing is used (may not be needed when using MSAA).
      • STENCIL_STROKES - Flag indicating if strokes should be drawn using stencil buffer. The rendering will be a little slower, but path overlaps (i.e. self-intersecting or sharp turns) will be drawn just once.
      • DEBUG - Flag indicating that additional debug checks are done.
      See Also:
    • NVG_DEBUG

      public static final int NVG_DEBUG
      Create flags.
      Enum values:
      • ANTIALIAS - Flag indicating if geometry based anti-aliasing is used (may not be needed when using MSAA).
      • STENCIL_STROKES - Flag indicating if strokes should be drawn using stencil buffer. The rendering will be a little slower, but path overlaps (i.e. self-intersecting or sharp turns) will be drawn just once.
      • DEBUG - Flag indicating that additional debug checks are done.
      See Also:
    • NVG_IMAGE_NODELETE

      public static final int NVG_IMAGE_NODELETE
      These are additional flags on top of NVGimageFlags.
      Enum values:
      See Also:
  • Method Details

    • nnvglCreateImageFromHandle

      public static int nnvglCreateImageFromHandle(long ctx, int textureId, int w, int h, int flags)
      Unsafe version of: lCreateImageFromHandle
    • nvglCreateImageFromHandle

      public static int nvglCreateImageFromHandle(long ctx, int textureId, int w, int h, int flags)
      Creates a NanoVG image from an OpenGL texture.
      Parameters:
      ctx - the NanoVG context
      textureId - the OpenGL texture id
      w - the image width
      h - the image height
      flags - the image flags
      Returns:
      a handle to the image
    • nnvglImageHandle

      public static int nnvglImageHandle(long ctx, int image)
      Unsafe version of: lImageHandle
    • nvglImageHandle

      public static int nvglImageHandle(long ctx, int image)
      Returns the OpenGL texture id associated with a NanoVG image.
      Parameters:
      ctx - the NanoVG context
      image - the image handle
    • nnvgCreate

      public static long nnvgCreate(int flags)
      Unsafe version of: Create
    • nvgCreate

      public static long nvgCreate(int flags)
      Creates a NanoVG context with an OpenGL 3.0 rendering back-end.

      An OpenGL 3.0+ context must be current in the current thread when this function is called and the returned NanoVG context may only be used in the thread in which that OpenGL context is current.

      Parameters:
      flags - the context flags. One of:
      ANTIALIASSTENCIL_STROKESDEBUG
    • nnvgDelete

      public static void nnvgDelete(long ctx)
      Unsafe version of: Delete
    • nvgDelete

      public static void nvgDelete(long ctx)
      Deletes a NanoVG context created with Create.
      Parameters:
      ctx - the NanoVG context
    • nnvgluCreateFramebuffer

      public static long nnvgluCreateFramebuffer(long ctx, int w, int h, int imageFlags)
      Unsafe version of: luCreateFramebuffer
    • nvgluCreateFramebuffer

      @Nullable public static NVGLUFramebuffer nvgluCreateFramebuffer(long ctx, int w, int h, int imageFlags)
      Creates a framebuffer object to render to.
      Parameters:
      ctx - the NanoVG context
      w - the framebuffer width
      h - the framebuffer height
      imageFlags - the image flags
    • nnvgluBindFramebuffer

      public static void nnvgluBindFramebuffer(long ctx, long fb)
      Unsafe version of: luBindFramebuffer
    • nvgluBindFramebuffer

      public static void nvgluBindFramebuffer(long ctx, @Nullable NVGLUFramebuffer fb)
      Binds the framebuffer object associated with the specified NVGLUFramebuffer.
      Parameters:
      ctx - the NanoVG context
      fb - the framebuffer to bind
    • nnvgluDeleteFramebuffer

      public static void nnvgluDeleteFramebuffer(long ctx, long fb)
      Unsafe version of: luDeleteFramebuffer
    • nvgluDeleteFramebuffer

      public static void nvgluDeleteFramebuffer(long ctx, NVGLUFramebuffer fb)
      Deletes an NVGLUFramebuffer.
      Parameters:
      ctx - the NanoVG context
      fb - the framebuffer to delete