Package org.lwjgl.system.macosx
Class CGPoint
- java.lang.Object
-
- org.lwjgl.system.Pointer.Default
-
- org.lwjgl.system.Struct
-
- org.lwjgl.system.macosx.CGPoint
-
- All Implemented Interfaces:
java.lang.AutoCloseable,NativeResource,Pointer
public class CGPoint extends Struct implements NativeResource
A structure that contains a point in a two-dimensional coordinate system.Member documentation
x– the x-coordinate of the pointy– the y-coordinate of the point
Layout
struct CGPoint { CGFloat x; CGFloat y; }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classCGPoint.BufferAn array ofCGPointstructs.-
Nested classes/interfaces inherited from interface org.lwjgl.system.Pointer
Pointer.Default
-
-
Field Summary
Fields Modifier and Type Field Description static intALIGNOFThe struct alignment in bytes.static intSIZEOFThe struct size in bytes.static intX
YThe struct member offsets.-
Fields inherited from interface org.lwjgl.system.Pointer
BITS32, BITS64, CLONG_SHIFT, CLONG_SIZE, POINTER_SHIFT, POINTER_SIZE
-
-
Constructor Summary
Constructors Constructor Description CGPoint(java.nio.ByteBuffer container)Creates aCGPointinstance at the current position of the specifiedByteBuffercontainer.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static CGPointcalloc()Returns a newCGPointinstance allocated withmemCalloc.static CGPoint.Buffercalloc(int capacity)Returns a newCGPoint.Bufferinstance allocated withmemCalloc.static CGPointcallocStack()Returns a newCGPointinstance allocated on the thread-localMemoryStackand initializes all its bits to zero.static CGPoint.BuffercallocStack(int capacity)Returns a newCGPoint.Bufferinstance allocated on the thread-localMemoryStackand initializes all its bits to zero.static CGPoint.BuffercallocStack(int capacity, MemoryStack stack)Returns a newCGPoint.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static CGPointcallocStack(MemoryStack stack)Returns a newCGPointinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static CGPointcreate()Returns a newCGPointinstance allocated withBufferUtils.static CGPoint.Buffercreate(int capacity)Returns a newCGPoint.Bufferinstance allocated withBufferUtils.static CGPointcreate(long address)Returns a newCGPointinstance for the specified memory address.static CGPoint.Buffercreate(long address, int capacity)Create aCGPoint.Bufferinstance at the specified memory.static CGPointcreateSafe(long address)static CGPoint.BuffercreateSafe(long address, int capacity)static CGPointmalloc()Returns a newCGPointinstance allocated withmemAlloc.static CGPoint.Buffermalloc(int capacity)Returns a newCGPoint.Bufferinstance allocated withmemAlloc.static CGPointmallocStack()Returns a newCGPointinstance allocated on the thread-localMemoryStack.static CGPoint.BuffermallocStack(int capacity)Returns a newCGPoint.Bufferinstance allocated on the thread-localMemoryStack.static CGPoint.BuffermallocStack(int capacity, MemoryStack stack)Returns a newCGPoint.Bufferinstance allocated on the specifiedMemoryStack.static CGPointmallocStack(MemoryStack stack)Returns a newCGPointinstance allocated on the specifiedMemoryStack.static doublenx(long struct)Unsafe version ofx().static voidnx(long struct, double value)Unsafe version ofx.static doubleny(long struct)Unsafe version ofy().static voidny(long struct, double value)Unsafe version ofy.CGPointset(double x, double y)Initializes this struct with the specified values.CGPointset(CGPoint src)Copies the specified struct data to this struct.intsizeof()Returnssizeof(struct).doublex()Returns the value of thexfield.CGPointx(double value)Sets the specified value to thexfield.doubley()Returns the value of theyfield.CGPointy(double value)Sets the specified value to theyfield.-
Methods inherited from interface org.lwjgl.system.NativeResource
close, free
-
Methods inherited from class org.lwjgl.system.Pointer.Default
address, equals, hashCode, toString
-
-
-
-
Constructor Detail
-
CGPoint
public CGPoint(java.nio.ByteBuffer container)
Creates aCGPointinstance 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()
Description copied from class:StructReturnssizeof(struct).
-
x
public double x()
Returns the value of thexfield.
-
y
public double y()
Returns the value of theyfield.
-
x
public CGPoint x(double value)
Sets the specified value to thexfield.
-
y
public CGPoint y(double value)
Sets the specified value to theyfield.
-
set
public CGPoint set(double x, double y)
Initializes this struct with the specified values.
-
set
public CGPoint set(CGPoint src)
Copies the specified struct data to this struct.- Parameters:
src- the source struct- Returns:
- this struct
-
malloc
public static CGPoint malloc()
Returns a newCGPointinstance allocated withmemAlloc. The instance must be explicitly freed.
-
calloc
public static CGPoint calloc()
Returns a newCGPointinstance allocated withmemCalloc. The instance must be explicitly freed.
-
create
public static CGPoint create()
Returns a newCGPointinstance allocated withBufferUtils.
-
create
public static CGPoint create(long address)
Returns a newCGPointinstance for the specified memory address.
-
createSafe
@Nullable public static CGPoint createSafe(long address)
-
malloc
public static CGPoint.Buffer malloc(int capacity)
Returns a newCGPoint.Bufferinstance allocated withmemAlloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
calloc
public static CGPoint.Buffer calloc(int capacity)
Returns a newCGPoint.Bufferinstance allocated withmemCalloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
create
public static CGPoint.Buffer create(int capacity)
Returns a newCGPoint.Bufferinstance allocated withBufferUtils.- Parameters:
capacity- the buffer capacity
-
create
public static CGPoint.Buffer create(long address, int capacity)
Create aCGPoint.Bufferinstance at the specified memory.- Parameters:
address- the memory addresscapacity- the buffer capacity
-
createSafe
@Nullable public static CGPoint.Buffer createSafe(long address, int capacity)
-
mallocStack
public static CGPoint mallocStack()
Returns a newCGPointinstance allocated on the thread-localMemoryStack.
-
callocStack
public static CGPoint callocStack()
Returns a newCGPointinstance allocated on the thread-localMemoryStackand initializes all its bits to zero.
-
mallocStack
public static CGPoint mallocStack(MemoryStack stack)
Returns a newCGPointinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocate
-
callocStack
public static CGPoint callocStack(MemoryStack stack)
Returns a newCGPointinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
stack- the stack from which to allocate
-
mallocStack
public static CGPoint.Buffer mallocStack(int capacity)
Returns a newCGPoint.Bufferinstance allocated on the thread-localMemoryStack.- Parameters:
capacity- the buffer capacity
-
callocStack
public static CGPoint.Buffer callocStack(int capacity)
Returns a newCGPoint.Bufferinstance allocated on the thread-localMemoryStackand initializes all its bits to zero.- Parameters:
capacity- the buffer capacity
-
mallocStack
public static CGPoint.Buffer mallocStack(int capacity, MemoryStack stack)
Returns a newCGPoint.Bufferinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocatecapacity- the buffer capacity
-
callocStack
public static CGPoint.Buffer callocStack(int capacity, MemoryStack stack)
Returns a newCGPoint.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
stack- the stack from which to allocatecapacity- the buffer capacity
-
nx
public static double nx(long struct)
Unsafe version ofx().
-
ny
public static double ny(long struct)
Unsafe version ofy().
-
nx
public static void nx(long struct, double value)Unsafe version ofx.
-
ny
public static void ny(long struct, double value)Unsafe version ofy.
-
-