Class ShadercIncludeResult

  • All Implemented Interfaces:
    java.lang.AutoCloseable, NativeResource, Pointer

    public class ShadercIncludeResult
    extends Struct
    implements NativeResource
    An include result.

    Member documentation

    • source_name – the name of the source file.

      The name should be fully resolved in the sense that it should be a unique name in the context of the includer. For example, if the includer maps source names to files in a filesystem, then this name should be the absolute path of the file. For a failed inclusion, this string is empty.

    • content – the text contents of the source file in the normal case. For a failed inclusion, this contains the error message.
    • user_data – user data to be passed along with this request

    Layout

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

      • SIZEOF

        The struct size in bytes.
      • ALIGNOF

        The struct alignment in bytes.
      • SOURCE_NAME, SOURCE_NAME_LENGTH, CONTENT, CONTENT_LENGTH, USER_DATA

        The struct member offsets.
    • Constructor Detail

      • ShadercIncludeResult

        public ShadercIncludeResult​(java.nio.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 Detail

      • sizeof

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

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

        public java.lang.String source_nameString()
        Decodes 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 java.nio.ByteBuffer content()
        Returns a ByteBuffer view of the null-terminated string pointed to by the content field.
      • contentString

        public java.lang.String contentString()
        Decodes 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​(java.nio.ByteBuffer value)
        Sets the address of the specified encoded string to the source_name field.
      • content

        public ShadercIncludeResult content​(java.nio.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​(java.nio.ByteBuffer source_name,
                                        java.nio.ByteBuffer content,
                                        long user_data)
        Initializes this struct with the specified values.
      • 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​(long address)
        Returns a new ShadercIncludeResult instance for the specified memory address.
      • createSafe

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

        public static ShadercIncludeResult callocStack()
        Returns a new ShadercIncludeResult instance allocated on the thread-local MemoryStack and initializes all its bits to zero.
      • mallocStack

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

        public static ShadercIncludeResult callocStack​(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
      • nsource_name

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

        public static java.lang.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 java.nio.ByteBuffer ncontent​(long struct)
        Unsafe version of content().
      • ncontentString

        public static java.lang.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,
                                        java.nio.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,
                                    java.nio.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
      • validate

        public static void validate​(long array,
                                    int count)
        Calls validate(long) for each struct contained in the specified struct array.
        Parameters:
        array - the struct array to validate
        count - the number of structs in array