Class ShadercIncludeResult

All Implemented Interfaces:
AutoCloseable, NativeResource, Pointer

public class ShadercIncludeResult extends Struct<ShadercIncludeResult> implements NativeResource

 struct shaderc_include_result {
     char const * source_name;
     size_t source_name_length;
     char const * content;
     size_t content_length;
     void * user_data;
 }
  • Field Details

    • SIZEOF

      public static final int SIZEOF
      The struct size in bytes.
    • ALIGNOF

      public static final int ALIGNOF
      The struct alignment in bytes.
    • SOURCE_NAME

      public static final int SOURCE_NAME
      The struct member offsets.
    • SOURCE_NAME_LENGTH

      public static final int SOURCE_NAME_LENGTH
      The struct member offsets.
    • CONTENT

      public static final int CONTENT
      The struct member offsets.
    • CONTENT_LENGTH

      public static final int CONTENT_LENGTH
      The struct member offsets.
    • USER_DATA

      public static final int USER_DATA
      The struct member offsets.
  • Constructor Details

    • ShadercIncludeResult

      public ShadercIncludeResult(ByteBuffer container)
      Creates a ShadercIncludeResult instance at the current position of the specified ByteBuffer container. Changes to the buffer's content will be visible to the struct instance and vice versa.

      The created instance holds a strong reference to the container object.

  • Method Details

    • sizeof

      public int sizeof()
      Description copied from class: Struct
      Returns sizeof(struct).
      Specified by:
      sizeof in class Struct<ShadercIncludeResult>
    • source_name

      public ByteBuffer source_name()
      Returns:
      a ByteBuffer view of the null-terminated string pointed to by the source_name field.
    • source_nameString

      public String source_nameString()
      Returns:
      the null-terminated string pointed to by the source_name field.
    • source_name_length

      public long source_name_length()
      Returns:
      the value of the source_name_length field.
    • content

      public ByteBuffer content()
      Returns:
      a ByteBuffer view of the null-terminated string pointed to by the content field.
    • contentString

      public String contentString()
      Returns:
      the null-terminated string pointed to by the content field.
    • content_length

      public long content_length()
      Returns:
      the value of the content_length field.
    • user_data

      public long user_data()
      Returns:
      the value of the user_data field.
    • source_name

      public ShadercIncludeResult source_name(ByteBuffer value)
      Sets the address of the specified encoded string to the source_name field.
    • content

      public ShadercIncludeResult content(ByteBuffer value)
      Sets the address of the specified encoded string to the content field.
    • user_data

      public ShadercIncludeResult user_data(long value)
      Sets the specified value to the user_data field.
    • set

      public ShadercIncludeResult set(ByteBuffer source_name, ByteBuffer content, long user_data)
      Initializes this struct with the specified values.
    • set

      Copies the specified struct data to this struct.
      Parameters:
      src - the source struct
      Returns:
      this struct
    • malloc

      public static ShadercIncludeResult malloc()
      Returns a new ShadercIncludeResult instance allocated with memAlloc. The instance must be explicitly freed.
    • calloc

      public static ShadercIncludeResult calloc()
      Returns a new ShadercIncludeResult instance allocated with memCalloc. The instance must be explicitly freed.
    • create

      public static ShadercIncludeResult create()
      Returns a new ShadercIncludeResult instance allocated with BufferUtils.
    • create

      public static ShadercIncludeResult create(long address)
      Returns a new ShadercIncludeResult instance for the specified memory address.
    • createSafe

      public static @Nullable ShadercIncludeResult createSafe(long address)
      Like create, but returns null if address is NULL.
    • malloc

      public static ShadercIncludeResult.Buffer malloc(int capacity)
      Returns a new ShadercIncludeResult.Buffer instance allocated with memAlloc. The instance must be explicitly freed.
      Parameters:
      capacity - the buffer capacity
    • calloc

      public static ShadercIncludeResult.Buffer calloc(int capacity)
      Returns a new ShadercIncludeResult.Buffer instance allocated with memCalloc. The instance must be explicitly freed.
      Parameters:
      capacity - the buffer capacity
    • create

      public static ShadercIncludeResult.Buffer create(int capacity)
      Returns a new ShadercIncludeResult.Buffer instance allocated with BufferUtils.
      Parameters:
      capacity - the buffer capacity
    • create

      public static ShadercIncludeResult.Buffer create(long address, int capacity)
      Create a ShadercIncludeResult.Buffer instance at the specified memory.
      Parameters:
      address - the memory address
      capacity - the buffer capacity
    • createSafe

      public static @Nullable ShadercIncludeResult.Buffer createSafe(long address, int capacity)
      Like create, but returns null if address is NULL.
    • malloc

      public static ShadercIncludeResult malloc(MemoryStack stack)
      Returns a new ShadercIncludeResult instance allocated on the specified MemoryStack.
      Parameters:
      stack - the stack from which to allocate
    • calloc

      public static ShadercIncludeResult calloc(MemoryStack stack)
      Returns a new ShadercIncludeResult instance allocated on the specified MemoryStack and initializes all its bits to zero.
      Parameters:
      stack - the stack from which to allocate
    • malloc

      public static ShadercIncludeResult.Buffer malloc(int capacity, MemoryStack stack)
      Returns a new ShadercIncludeResult.Buffer instance allocated on the specified MemoryStack.
      Parameters:
      capacity - the buffer capacity
      stack - the stack from which to allocate
    • calloc

      public static ShadercIncludeResult.Buffer calloc(int capacity, MemoryStack stack)
      Returns a new ShadercIncludeResult.Buffer instance allocated on the specified MemoryStack and initializes all its bits to zero.
      Parameters:
      capacity - the buffer capacity
      stack - the stack from which to allocate
    • nsource_name

      public static ByteBuffer nsource_name(long struct)
      Unsafe version of source_name().
    • nsource_nameString

      public static String nsource_nameString(long struct)
      Unsafe version of source_nameString().
    • nsource_name_length

      public static long nsource_name_length(long struct)
      Unsafe version of source_name_length().
    • ncontent

      public static ByteBuffer ncontent(long struct)
      Unsafe version of content().
    • ncontentString

      public static String ncontentString(long struct)
      Unsafe version of contentString().
    • ncontent_length

      public static long ncontent_length(long struct)
      Unsafe version of content_length().
    • nuser_data

      public static long nuser_data(long struct)
      Unsafe version of user_data().
    • nsource_name

      public static void nsource_name(long struct, ByteBuffer value)
      Unsafe version of source_name.
    • nsource_name_length

      public static void nsource_name_length(long struct, long value)
      Sets the specified value to the source_name_length field of the specified struct.
    • ncontent

      public static void ncontent(long struct, ByteBuffer value)
      Unsafe version of content.
    • ncontent_length

      public static void ncontent_length(long struct, long value)
      Sets the specified value to the content_length field of the specified struct.
    • nuser_data

      public static void nuser_data(long struct, long value)
      Unsafe version of user_data.
    • validate

      public static void validate(long struct)
      Validates pointer members that should not be NULL.
      Parameters:
      struct - the struct to validate