Package org.lwjgl.util.shaderc
Class ShadercIncludeResult
- java.lang.Object
-
- org.lwjgl.system.Pointer.Default
-
- org.lwjgl.system.Struct
-
- org.lwjgl.util.shaderc.ShadercIncludeResult
-
- All Implemented Interfaces:
java.lang.AutoCloseable
,org.lwjgl.system.NativeResource
,org.lwjgl.system.Pointer
public class ShadercIncludeResult extends org.lwjgl.system.Struct implements org.lwjgl.system.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; }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ShadercIncludeResult.Buffer
An array ofShadercIncludeResult
structs.
-
Field Summary
Fields Modifier and Type Field Description static int
ALIGNOF
The struct alignment in bytes.static int
CONTENT
CONTENT_LENGTHThe struct member offsets.static int
SIZEOF
The struct size in bytes.static int
SOURCE_NAME
SOURCE_NAME_LENGTH
USER_DATAThe struct member offsets.
-
Constructor Summary
Constructors Constructor Description ShadercIncludeResult(java.nio.ByteBuffer container)
Creates aShadercIncludeResult
instance at the current position of the specifiedByteBuffer
container.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ShadercIncludeResult
calloc()
Returns a newShadercIncludeResult
instance allocated withmemCalloc
.static ShadercIncludeResult.Buffer
calloc(int capacity)
Returns a newShadercIncludeResult.Buffer
instance allocated withmemCalloc
.static ShadercIncludeResult
callocStack()
Returns a newShadercIncludeResult
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.static ShadercIncludeResult.Buffer
callocStack(int capacity)
Returns a newShadercIncludeResult.Buffer
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.static ShadercIncludeResult.Buffer
callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newShadercIncludeResult.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static ShadercIncludeResult
callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newShadercIncludeResult
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.java.nio.ByteBuffer
content()
Returns aByteBuffer
view of the null-terminated string pointed to by thecontent
field.ShadercIncludeResult
content(java.nio.ByteBuffer value)
Sets the address of the specified encoded string to thecontent
field.long
content_length()
Returns the value of thecontent_length
field.java.lang.String
contentString()
Decodes the null-terminated string pointed to by thecontent
field.static ShadercIncludeResult
create()
Returns a newShadercIncludeResult
instance allocated withBufferUtils
.static ShadercIncludeResult.Buffer
create(int capacity)
Returns a newShadercIncludeResult.Buffer
instance allocated withBufferUtils
.static ShadercIncludeResult
create(long address)
Returns a newShadercIncludeResult
instance for the specified memory address.static ShadercIncludeResult.Buffer
create(long address, int capacity)
Create aShadercIncludeResult.Buffer
instance at the specified memory.static ShadercIncludeResult
createSafe(long address)
static ShadercIncludeResult.Buffer
createSafe(long address, int capacity)
static ShadercIncludeResult
malloc()
Returns a newShadercIncludeResult
instance allocated withmemAlloc
.static ShadercIncludeResult.Buffer
malloc(int capacity)
Returns a newShadercIncludeResult.Buffer
instance allocated withmemAlloc
.static ShadercIncludeResult
mallocStack()
Returns a newShadercIncludeResult
instance allocated on the thread-localMemoryStack
.static ShadercIncludeResult.Buffer
mallocStack(int capacity)
Returns a newShadercIncludeResult.Buffer
instance allocated on the thread-localMemoryStack
.static ShadercIncludeResult.Buffer
mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newShadercIncludeResult.Buffer
instance allocated on the specifiedMemoryStack
.static ShadercIncludeResult
mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newShadercIncludeResult
instance allocated on the specifiedMemoryStack
.static java.nio.ByteBuffer
ncontent(long struct)
Unsafe version ofcontent()
.static void
ncontent(long struct, java.nio.ByteBuffer value)
Unsafe version ofcontent
.static long
ncontent_length(long struct)
Unsafe version ofcontent_length()
.static void
ncontent_length(long struct, long value)
Sets the specified value to thecontent_length
field of the specifiedstruct
.static java.lang.String
ncontentString(long struct)
Unsafe version ofcontentString()
.static java.nio.ByteBuffer
nsource_name(long struct)
Unsafe version ofsource_name()
.static void
nsource_name(long struct, java.nio.ByteBuffer value)
Unsafe version ofsource_name
.static long
nsource_name_length(long struct)
Unsafe version ofsource_name_length()
.static void
nsource_name_length(long struct, long value)
Sets the specified value to thesource_name_length
field of the specifiedstruct
.static java.lang.String
nsource_nameString(long struct)
Unsafe version ofsource_nameString()
.static long
nuser_data(long struct)
Unsafe version ofuser_data()
.static void
nuser_data(long struct, long value)
Unsafe version ofuser_data
.ShadercIncludeResult
set(java.nio.ByteBuffer source_name, java.nio.ByteBuffer content, long user_data)
Initializes this struct with the specified values.ShadercIncludeResult
set(ShadercIncludeResult src)
Copies the specified struct data to this struct.int
sizeof()
java.nio.ByteBuffer
source_name()
Returns aByteBuffer
view of the null-terminated string pointed to by thesource_name
field.ShadercIncludeResult
source_name(java.nio.ByteBuffer value)
Sets the address of the specified encoded string to thesource_name
field.long
source_name_length()
Returns the value of thesource_name_length
field.java.lang.String
source_nameString()
Decodes the null-terminated string pointed to by thesource_name
field.long
user_data()
Returns the value of theuser_data
field.ShadercIncludeResult
user_data(long value)
Sets the specified value to theuser_data
field.static void
validate(long struct)
Validates pointer members that should not beNULL
.static void
validate(long array, int count)
Callsvalidate(long)
for each struct contained in the specified struct array.
-
-
-
Constructor Detail
-
ShadercIncludeResult
public ShadercIncludeResult(java.nio.ByteBuffer container)
Creates aShadercIncludeResult
instance at the current position of the specifiedByteBuffer
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()
- Specified by:
sizeof
in classorg.lwjgl.system.Struct
-
source_name
public java.nio.ByteBuffer source_name()
Returns aByteBuffer
view of the null-terminated string pointed to by thesource_name
field.
-
source_nameString
public java.lang.String source_nameString()
Decodes the null-terminated string pointed to by thesource_name
field.
-
source_name_length
public long source_name_length()
Returns the value of thesource_name_length
field.
-
content
public java.nio.ByteBuffer content()
Returns aByteBuffer
view of the null-terminated string pointed to by thecontent
field.
-
contentString
public java.lang.String contentString()
Decodes the null-terminated string pointed to by thecontent
field.
-
content_length
public long content_length()
Returns the value of thecontent_length
field.
-
user_data
public long user_data()
Returns the value of theuser_data
field.
-
source_name
public ShadercIncludeResult source_name(java.nio.ByteBuffer value)
Sets the address of the specified encoded string to thesource_name
field.
-
content
public ShadercIncludeResult content(java.nio.ByteBuffer value)
Sets the address of the specified encoded string to thecontent
field.
-
user_data
public ShadercIncludeResult user_data(long value)
Sets the specified value to theuser_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.
-
set
public ShadercIncludeResult set(ShadercIncludeResult src)
Copies the specified struct data to this struct.- Parameters:
src
- the source struct- Returns:
- this struct
-
malloc
public static ShadercIncludeResult malloc()
Returns a newShadercIncludeResult
instance allocated withmemAlloc
. The instance must be explicitly freed.
-
calloc
public static ShadercIncludeResult calloc()
Returns a newShadercIncludeResult
instance allocated withmemCalloc
. The instance must be explicitly freed.
-
create
public static ShadercIncludeResult create()
Returns a newShadercIncludeResult
instance allocated withBufferUtils
.
-
create
public static ShadercIncludeResult create(long address)
Returns a newShadercIncludeResult
instance for the specified memory address.
-
createSafe
@Nullable public static ShadercIncludeResult createSafe(long address)
-
malloc
public static ShadercIncludeResult.Buffer malloc(int capacity)
Returns a newShadercIncludeResult.Buffer
instance allocated withmemAlloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
calloc
public static ShadercIncludeResult.Buffer calloc(int capacity)
Returns a newShadercIncludeResult.Buffer
instance allocated withmemCalloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
create
public static ShadercIncludeResult.Buffer create(int capacity)
Returns a newShadercIncludeResult.Buffer
instance allocated withBufferUtils
.- Parameters:
capacity
- the buffer capacity
-
create
public static ShadercIncludeResult.Buffer create(long address, int capacity)
Create aShadercIncludeResult.Buffer
instance at the specified memory.- Parameters:
address
- the memory addresscapacity
- the buffer capacity
-
createSafe
@Nullable public static ShadercIncludeResult.Buffer createSafe(long address, int capacity)
-
mallocStack
public static ShadercIncludeResult mallocStack()
Returns a newShadercIncludeResult
instance allocated on the thread-localMemoryStack
.
-
callocStack
public static ShadercIncludeResult callocStack()
Returns a newShadercIncludeResult
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.
-
mallocStack
public static ShadercIncludeResult mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newShadercIncludeResult
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocate
-
callocStack
public static ShadercIncludeResult callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newShadercIncludeResult
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.- Parameters:
stack
- the stack from which to allocate
-
mallocStack
public static ShadercIncludeResult.Buffer mallocStack(int capacity)
Returns a newShadercIncludeResult.Buffer
instance allocated on the thread-localMemoryStack
.- Parameters:
capacity
- the buffer capacity
-
callocStack
public static ShadercIncludeResult.Buffer callocStack(int capacity)
Returns a newShadercIncludeResult.Buffer
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.- Parameters:
capacity
- the buffer capacity
-
mallocStack
public static ShadercIncludeResult.Buffer mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newShadercIncludeResult.Buffer
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocatecapacity
- the buffer capacity
-
callocStack
public static ShadercIncludeResult.Buffer callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newShadercIncludeResult.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.- Parameters:
stack
- the stack from which to allocatecapacity
- the buffer capacity
-
nsource_name
public static java.nio.ByteBuffer nsource_name(long struct)
Unsafe version ofsource_name()
.
-
nsource_nameString
public static java.lang.String nsource_nameString(long struct)
Unsafe version ofsource_nameString()
.
-
nsource_name_length
public static long nsource_name_length(long struct)
Unsafe version ofsource_name_length()
.
-
ncontent
public static java.nio.ByteBuffer ncontent(long struct)
Unsafe version ofcontent()
.
-
ncontentString
public static java.lang.String ncontentString(long struct)
Unsafe version ofcontentString()
.
-
ncontent_length
public static long ncontent_length(long struct)
Unsafe version ofcontent_length()
.
-
nuser_data
public static long nuser_data(long struct)
Unsafe version ofuser_data()
.
-
nsource_name
public static void nsource_name(long struct, java.nio.ByteBuffer value)
Unsafe version ofsource_name
.
-
nsource_name_length
public static void nsource_name_length(long struct, long value)
Sets the specified value to thesource_name_length
field of the specifiedstruct
.
-
ncontent
public static void ncontent(long struct, java.nio.ByteBuffer value)
Unsafe version ofcontent
.
-
ncontent_length
public static void ncontent_length(long struct, long value)
Sets the specified value to thecontent_length
field of the specifiedstruct
.
-
nuser_data
public static void nuser_data(long struct, long value)
Unsafe version ofuser_data
.
-
validate
public static void validate(long struct)
Validates pointer members that should not beNULL
.- Parameters:
struct
- the struct to validate
-
validate
public static void validate(long array, int count)
Callsvalidate(long)
for each struct contained in the specified struct array.- Parameters:
array
- the struct array to validatecount
- the number of structs inarray
-
-