Interface Texture

All Known Implementing Classes:
Texture.CppProxy

public interface Texture
Class, which repesent 2D texture interface. Subclass of image
  • Method Details

    • loadResource

      void loadResource(@Nullable Resource res)
    • loadByFd

      void loadByFd(int fd)
      Load texture data from specified file descriptor.
      Parameters:
      fd - (i32): file descriptor, should be closed on the caller side.
    • load

      void load(@NonNull String fileName)
      Load texture data from specified file name. For now only supported .png, .jpeg, .jpg, .ktx (2d) images.
      Parameters:
      fileName - (string): absolute path for image file
    • getWidth

      int getWidth()
      Returns:
      width (int) of loaded image
    • getHeight

      int getHeight()
      Returns:
      height (int) of loaded image
    • getLayers

      int getLayers()
      Returns:
      channels count of loaded image (R, RG, RGBA, i.e. 1, 2, or 4).
    • setMips

      void setMips(boolean enable)
      set mimpap generation flag. (affect only on ogl backend).
      Parameters:
      enable - (bool): mipmap generation enable flag.
    • hasMips

      boolean hasMips()
      Returns:
      flag (bool) : mimpap generation flag
    • setTiling

      void setTiling(boolean enable)
      enable/disable texture tiling
      Parameters:
      enable - (bool): tiled wrapping flag
    • getTiling

      boolean getTiling()
      Returns:
      tiled texture wrapping flag (bool).
    • setFiltering

      void setFiltering(@NonNull TextureFilteringMode type)
      set texture filtering mode param mode (texture_filtering_mode)
    • getFilteringMode

      @NonNull TextureFilteringMode getFilteringMode()
      Returns:
      filtering mode (texture_filtering_mode)
    • asImage

      @Nullable Image asImage()
      Returns:
      upcast to base type