Package org.lwjgl.util.yoga
Class YGValue
- java.lang.Object
-
- org.lwjgl.system.Pointer.Default
-
- org.lwjgl.system.Struct
-
- org.lwjgl.util.yoga.YGValue
-
- All Implemented Interfaces:
java.lang.AutoCloseable,org.lwjgl.system.NativeResource,org.lwjgl.system.Pointer
public class YGValue extends org.lwjgl.system.Struct implements org.lwjgl.system.NativeResourceLayout
struct YGValue { float value; YGUnit unit; }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classYGValue.BufferAn array ofYGValuestructs.
-
Constructor Summary
Constructors Constructor Description YGValue(java.nio.ByteBuffer container)Creates aYGValueinstance at the current position of the specifiedByteBuffercontainer.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static YGValuecalloc()Returns a newYGValueinstance allocated withmemCalloc.static YGValue.Buffercalloc(int capacity)Returns a newYGValue.Bufferinstance allocated withmemCalloc.static YGValue.Buffercalloc(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newYGValue.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static YGValuecalloc(org.lwjgl.system.MemoryStack stack)Returns a newYGValueinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static YGValuecallocStack()Deprecated.static YGValue.BuffercallocStack(int capacity)Deprecated.static YGValue.BuffercallocStack(int capacity, org.lwjgl.system.MemoryStack stack)Deprecated.static YGValuecallocStack(org.lwjgl.system.MemoryStack stack)Deprecated.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 YGValuecreateSafe(long address)static 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, org.lwjgl.system.MemoryStack stack)Returns a newYGValue.Bufferinstance allocated on the specifiedMemoryStack.static YGValuemalloc(org.lwjgl.system.MemoryStack stack)Returns a newYGValueinstance allocated on the specifiedMemoryStack.static YGValuemallocStack()Deprecated.static YGValue.BuffermallocStack(int capacity)Deprecated.static YGValue.BuffermallocStack(int capacity, org.lwjgl.system.MemoryStack stack)Deprecated.static YGValuemallocStack(org.lwjgl.system.MemoryStack stack)Deprecated.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.YGValueset(float value, int unit)Initializes this struct with the specified values.YGValueset(YGValue src)Copies the specified struct data to this struct.intsizeof()intunit()YGValueunit(int value)Sets the specified value to theunitfield.floatvalue()YGValuevalue(float value)Sets the specified value to thevaluefield.
-
-
-
Constructor Detail
-
YGValue
public YGValue(java.nio.ByteBuffer container)
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 Detail
-
sizeof
public int sizeof()
- Specified by:
sizeofin classorg.lwjgl.system.Struct
-
value
public float value()
- Returns:
- the value of the
valuefield.
-
unit
public int unit()
- Returns:
- the value of the
unitfield.
-
value
public YGValue value(float value)
Sets the specified value to thevaluefield.
-
unit
public YGValue unit(int value)
Sets the specified value to theunitfield.
-
set
public YGValue set(float value, int unit)
Initializes this struct with the specified values.
-
set
public YGValue set(YGValue src)
Copies the specified struct data to this struct.- Parameters:
src- the source struct- Returns:
- this struct
-
malloc
public static YGValue malloc()
Returns a newYGValueinstance allocated withmemAlloc. The instance must be explicitly freed.
-
calloc
public static YGValue calloc()
Returns a newYGValueinstance allocated withmemCalloc. The instance must be explicitly freed.
-
create
public static YGValue create()
Returns a newYGValueinstance allocated withBufferUtils.
-
create
public static YGValue create(long address)
Returns a newYGValueinstance for the specified memory address.
-
createSafe
@Nullable public static YGValue createSafe(long address)
-
malloc
public static YGValue.Buffer malloc(int capacity)
Returns a newYGValue.Bufferinstance allocated withmemAlloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
calloc
public static YGValue.Buffer calloc(int capacity)
Returns a newYGValue.Bufferinstance allocated withmemCalloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
create
public static YGValue.Buffer create(int capacity)
Returns a newYGValue.Bufferinstance allocated withBufferUtils.- Parameters:
capacity- the buffer capacity
-
create
public static YGValue.Buffer create(long address, int capacity)
Create aYGValue.Bufferinstance at the specified memory.- Parameters:
address- the memory addresscapacity- the buffer capacity
-
createSafe
@Nullable public static YGValue.Buffer createSafe(long address, int capacity)
-
mallocStack
@Deprecated public static YGValue mallocStack()
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(MemoryStack)instead.
-
callocStack
@Deprecated public static YGValue callocStack()
Deprecated.Deprecated for removal in 3.4.0. Usecalloc(MemoryStack)instead.
-
mallocStack
@Deprecated public static YGValue mallocStack(org.lwjgl.system.MemoryStack stack)
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(MemoryStack)instead.
-
callocStack
@Deprecated public static YGValue callocStack(org.lwjgl.system.MemoryStack stack)
Deprecated.Deprecated for removal in 3.4.0. Usecalloc(MemoryStack)instead.
-
mallocStack
@Deprecated public static YGValue.Buffer mallocStack(int capacity)
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(int, MemoryStack)instead.
-
callocStack
@Deprecated public static YGValue.Buffer callocStack(int capacity)
Deprecated.Deprecated for removal in 3.4.0. Usecalloc(int, MemoryStack)instead.
-
mallocStack
@Deprecated public static YGValue.Buffer mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(int, MemoryStack)instead.
-
callocStack
@Deprecated public static YGValue.Buffer callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Deprecated.Deprecated for removal in 3.4.0. Usecalloc(int, MemoryStack)instead.
-
malloc
public static YGValue malloc(org.lwjgl.system.MemoryStack stack)
Returns a newYGValueinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocate
-
calloc
public static YGValue calloc(org.lwjgl.system.MemoryStack stack)
Returns a newYGValueinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
stack- the stack from which to allocate
-
malloc
public static YGValue.Buffer malloc(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newYGValue.Bufferinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocatecapacity- the buffer capacity
-
calloc
public static YGValue.Buffer calloc(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newYGValue.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
stack- the stack from which to allocatecapacity- the buffer capacity
-
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.
-
-