Package org.lwjgl.util.yoga
Class YGValue
- All Implemented Interfaces:
AutoCloseable,NativeResource,Pointer
struct YGValue {
float value;
YGUnit unit;
}-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class org.lwjgl.system.Struct
Struct.StructValidationNested classes/interfaces inherited from interface org.lwjgl.system.Pointer
Pointer.Default -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe struct alignment in bytes.static final intThe struct size in bytes.static final intThe struct member offsets.static final intThe struct member offsets.Fields inherited from interface org.lwjgl.system.Pointer
BITS32, BITS64, CLONG_SHIFT, CLONG_SIZE, POINTER_SHIFT, POINTER_SIZE -
Constructor Summary
ConstructorsConstructorDescriptionYGValue(ByteBuffer container) Creates aYGValueinstance at the current position of the specifiedByteBuffercontainer. -
Method Summary
Modifier and TypeMethodDescriptionstatic YGValuecalloc()Returns a newYGValueinstance allocated withmemCalloc.static YGValue.Buffercalloc(int capacity) Returns a newYGValue.Bufferinstance allocated withmemCalloc.static YGValue.Buffercalloc(int capacity, MemoryStack stack) Returns a newYGValue.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static YGValuecalloc(MemoryStack stack) Returns a newYGValueinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static YGValuecreate()Returns a newYGValueinstance allocated withBufferUtils.static YGValue.Buffercreate(int capacity) Returns a newYGValue.Bufferinstance allocated withBufferUtils.static YGValuecreate(long address) Returns a newYGValueinstance for the specified memory address.static YGValue.Buffercreate(long address, int capacity) Create aYGValue.Bufferinstance at the specified memory.static @Nullable YGValuecreateSafe(long address) static @Nullable YGValue.BuffercreateSafe(long address, int capacity) static YGValuemalloc()Returns a newYGValueinstance allocated withmemAlloc.static YGValue.Buffermalloc(int capacity) Returns a newYGValue.Bufferinstance allocated withmemAlloc.static YGValue.Buffermalloc(int capacity, MemoryStack stack) Returns a newYGValue.Bufferinstance allocated on the specifiedMemoryStack.static YGValuemalloc(MemoryStack stack) Returns a newYGValueinstance allocated on the specifiedMemoryStack.static intnunit(long struct) Unsafe version ofunit().static voidnunit(long struct, int value) Unsafe version ofunit.static floatnvalue(long struct) Unsafe version ofvalue().static voidnvalue(long struct, float value) Unsafe version ofvalue.set(float value, int unit) Initializes this struct with the specified values.Copies the specified struct data to this struct.intsizeof()Returnssizeof(struct).intunit()unit(int value) Sets the specified value to theunitfield.floatvalue()value(float value) Sets the specified value to thevaluefield.Methods inherited from class org.lwjgl.system.Pointer.Default
address, equals, hashCode, toStringMethods inherited from interface org.lwjgl.system.NativeResource
close, free
-
Field Details
-
SIZEOF
public static final int SIZEOFThe struct size in bytes. -
ALIGNOF
public static final int ALIGNOFThe struct alignment in bytes. -
VALUE
public static final int VALUEThe struct member offsets. -
UNIT
public static final int UNITThe struct member offsets.
-
-
Constructor Details
-
YGValue
Creates aYGValueinstance at the current position of the specifiedByteBuffercontainer. 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:StructReturnssizeof(struct). -
value
public float value()- Returns:
- the value of the
valuefield.
-
unit
public int unit()- Returns:
- the value of the
unitfield.
-
value
Sets the specified value to thevaluefield. -
unit
Sets the specified value to theunitfield. -
set
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
Returns a newYGValueinstance allocated withmemAlloc. The instance must be explicitly freed. -
calloc
Returns a newYGValueinstance allocated withmemCalloc. The instance must be explicitly freed. -
create
Returns a newYGValueinstance allocated withBufferUtils. -
create
Returns a newYGValueinstance for the specified memory address. -
createSafe
-
malloc
Returns a newYGValue.Bufferinstance allocated withmemAlloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
calloc
Returns a newYGValue.Bufferinstance allocated withmemCalloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
create
Returns a newYGValue.Bufferinstance allocated withBufferUtils.- Parameters:
capacity- the buffer capacity
-
create
Create aYGValue.Bufferinstance at the specified memory.- Parameters:
address- the memory addresscapacity- the buffer capacity
-
createSafe
-
malloc
Returns a newYGValueinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocate
-
calloc
Returns a newYGValueinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
stack- the stack from which to allocate
-
malloc
Returns a newYGValue.Bufferinstance allocated on the specifiedMemoryStack.- Parameters:
capacity- the buffer capacitystack- the stack from which to allocate
-
calloc
Returns a newYGValue.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
capacity- the buffer capacitystack- the stack from which to allocate
-
nvalue
public static float nvalue(long struct) Unsafe version ofvalue(). -
nunit
public static int nunit(long struct) Unsafe version ofunit(). -
nvalue
public static void nvalue(long struct, float value) Unsafe version ofvalue. -
nunit
public static void nunit(long struct, int value) Unsafe version ofunit.
-