Class Texture

java.lang.Object
com.raylib.Texture

public class Texture extends Object
Texture, tex data stored in GPU memory (VRAM)
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    The native FFI MemorySegment that holds the data this object wraps.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Construct with auto memory allocator and fields initialized to zero.
    Texture(int id, int width, int height, int mipmaps, int format)
    Construct with auto memory allocator and fields initialized as specified
    Texture(MemorySegment memorySegment)
    Construct by wrapping around an already allocated MemorySegment, perhaps from another object
    Construct with your owm memory allocator and fields not initialized
    Texture(SegmentAllocator arena, int id, int width, int height, int mipmaps, int format)
    Construct with your own memory allocator and fields initialized as specified
  • Method Summary

    Modifier and Type
    Method
    Description
    static Texture
    allocateArray(long elementCount)
    Allocate an array of Texture
    static Texture
    allocateArray(long elementCount, SegmentAllocator allocator)
    Allocate an array of Texture
    boolean
    Equality is tested on basis of both wrapper objects must refer to same native memory location to be considered equal
    int
    Data format (PixelFormat type)
    format(int value)
    Data format (PixelFormat type)
    getArrayElement(int index)
     
    int
    Data format (PixelFormat type)
    int
    Texture base height
    int
    OpenGL texture id
    int
    Mipmap levels, 1 by default
    int
    Texture base width
    int
     
    int
    Texture base height
    height(int value)
    Texture base height
    int
    id()
    OpenGL texture id
    id(int value)
    OpenGL texture id
    int
    Mipmap levels, 1 by default
    mipmaps(int value)
    Mipmap levels, 1 by default
    void
    setFormat(int value)
    Data format (PixelFormat type)
    void
    setHeight(int value)
    Texture base height
    void
    setId(int value)
    OpenGL texture id
    void
    setMipmaps(int value)
    Mipmap levels, 1 by default
    void
    setWidth(int value)
    Texture base width
    int
    Texture base width
    width(int value)
    Texture base width

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • memorySegment

      public final MemorySegment memorySegment
      The native FFI MemorySegment that holds the data this object wraps.
  • Constructor Details

    • Texture

      public Texture()
      Construct with auto memory allocator and fields initialized to zero.
    • Texture

      public Texture(SegmentAllocator arena)
      Construct with your owm memory allocator and fields not initialized
    • Texture

      public Texture(MemorySegment memorySegment)
      Construct by wrapping around an already allocated MemorySegment, perhaps from another object
    • Texture

      public Texture(int id, int width, int height, int mipmaps, int format)
      Construct with auto memory allocator and fields initialized as specified
      Parameters:
      id - OpenGL texture id
      width - Texture base width
      height - Texture base height
      mipmaps - Mipmap levels, 1 by default
      format - Data format (PixelFormat type)
    • Texture

      public Texture(SegmentAllocator arena, int id, int width, int height, int mipmaps, int format)
      Construct with your own memory allocator and fields initialized as specified
      Parameters:
      id - OpenGL texture id
      width - Texture base width
      height - Texture base height
      mipmaps - Mipmap levels, 1 by default
      format - Data format (PixelFormat type)
  • Method Details

    • equals

      public boolean equals(Object o)
      Equality is tested on basis of both wrapper objects must refer to same native memory location to be considered equal
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • getArrayElement

      public Texture getArrayElement(int index)
    • allocateArray

      public static Texture allocateArray(long elementCount, SegmentAllocator allocator)
      Allocate an array of Texture
    • allocateArray

      public static Texture allocateArray(long elementCount)
      Allocate an array of Texture
    • getId

      public int getId()
      OpenGL texture id
    • setId

      public void setId(int value)
      OpenGL texture id
    • id

      public int id()
      OpenGL texture id
    • id

      public Texture id(int value)
      OpenGL texture id
    • getWidth

      public int getWidth()
      Texture base width
    • setWidth

      public void setWidth(int value)
      Texture base width
    • width

      public int width()
      Texture base width
    • width

      public Texture width(int value)
      Texture base width
    • getHeight

      public int getHeight()
      Texture base height
    • setHeight

      public void setHeight(int value)
      Texture base height
    • height

      public int height()
      Texture base height
    • height

      public Texture height(int value)
      Texture base height
    • getMipmaps

      public int getMipmaps()
      Mipmap levels, 1 by default
    • setMipmaps

      public void setMipmaps(int value)
      Mipmap levels, 1 by default
    • mipmaps

      public int mipmaps()
      Mipmap levels, 1 by default
    • mipmaps

      public Texture mipmaps(int value)
      Mipmap levels, 1 by default
    • getFormat

      public int getFormat()
      Data format (PixelFormat type)
    • setFormat

      public void setFormat(int value)
      Data format (PixelFormat type)
    • format

      public int format()
      Data format (PixelFormat type)
    • format

      public Texture format(int value)
      Data format (PixelFormat type)