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 class
CGPoint.Buffer
An array ofCGPoint
structs.-
Nested classes/interfaces inherited from interface org.lwjgl.system.Pointer
Pointer.Default
-
-
Field Summary
Fields Modifier and Type Field Description static int
ALIGNOF
The struct alignment in bytes.static int
SIZEOF
The struct size in bytes.static int
X
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 aCGPoint
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 CGPoint
calloc()
Returns a newCGPoint
instance allocated withmemCalloc
.static CGPoint.Buffer
calloc(int capacity)
Returns a newCGPoint.Buffer
instance allocated withmemCalloc
.static CGPoint
callocStack()
Returns a newCGPoint
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.static CGPoint.Buffer
callocStack(int capacity)
Returns a newCGPoint.Buffer
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.static CGPoint.Buffer
callocStack(int capacity, MemoryStack stack)
Returns a newCGPoint.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static CGPoint
callocStack(MemoryStack stack)
Returns a newCGPoint
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static CGPoint
create()
Returns a newCGPoint
instance allocated withBufferUtils
.static CGPoint.Buffer
create(int capacity)
Returns a newCGPoint.Buffer
instance allocated withBufferUtils
.static CGPoint
create(long address)
Returns a newCGPoint
instance for the specified memory address.static CGPoint.Buffer
create(long address, int capacity)
Create aCGPoint.Buffer
instance at the specified memory.static CGPoint
createSafe(long address)
static CGPoint.Buffer
createSafe(long address, int capacity)
static CGPoint
malloc()
Returns a newCGPoint
instance allocated withmemAlloc
.static CGPoint.Buffer
malloc(int capacity)
Returns a newCGPoint.Buffer
instance allocated withmemAlloc
.static CGPoint
mallocStack()
Returns a newCGPoint
instance allocated on the thread-localMemoryStack
.static CGPoint.Buffer
mallocStack(int capacity)
Returns a newCGPoint.Buffer
instance allocated on the thread-localMemoryStack
.static CGPoint.Buffer
mallocStack(int capacity, MemoryStack stack)
Returns a newCGPoint.Buffer
instance allocated on the specifiedMemoryStack
.static CGPoint
mallocStack(MemoryStack stack)
Returns a newCGPoint
instance allocated on the specifiedMemoryStack
.static double
nx(long struct)
Unsafe version ofx()
.static void
nx(long struct, double value)
Unsafe version ofx
.static double
ny(long struct)
Unsafe version ofy()
.static void
ny(long struct, double value)
Unsafe version ofy
.CGPoint
set(double x, double y)
Initializes this struct with the specified values.CGPoint
set(CGPoint src)
Copies the specified struct data to this struct.int
sizeof()
Returnssizeof(struct)
.double
x()
Returns the value of thex
field.CGPoint
x(double value)
Sets the specified value to thex
field.double
y()
Returns the value of they
field.CGPoint
y(double value)
Sets the specified value to they
field.-
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 aCGPoint
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()
Description copied from class:Struct
Returnssizeof(struct)
.
-
x
public double x()
Returns the value of thex
field.
-
y
public double y()
Returns the value of they
field.
-
x
public CGPoint x(double value)
Sets the specified value to thex
field.
-
y
public CGPoint y(double value)
Sets the specified value to they
field.
-
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 newCGPoint
instance allocated withmemAlloc
. The instance must be explicitly freed.
-
calloc
public static CGPoint calloc()
Returns a newCGPoint
instance allocated withmemCalloc
. The instance must be explicitly freed.
-
create
public static CGPoint create()
Returns a newCGPoint
instance allocated withBufferUtils
.
-
create
public static CGPoint create(long address)
Returns a newCGPoint
instance for the specified memory address.
-
createSafe
@Nullable public static CGPoint createSafe(long address)
-
malloc
public static CGPoint.Buffer malloc(int capacity)
Returns a newCGPoint.Buffer
instance allocated withmemAlloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
calloc
public static CGPoint.Buffer calloc(int capacity)
Returns a newCGPoint.Buffer
instance allocated withmemCalloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
create
public static CGPoint.Buffer create(int capacity)
Returns a newCGPoint.Buffer
instance allocated withBufferUtils
.- Parameters:
capacity
- the buffer capacity
-
create
public static CGPoint.Buffer create(long address, int capacity)
Create aCGPoint.Buffer
instance 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 newCGPoint
instance allocated on the thread-localMemoryStack
.
-
callocStack
public static CGPoint callocStack()
Returns a newCGPoint
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.
-
mallocStack
public static CGPoint mallocStack(MemoryStack stack)
Returns a newCGPoint
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocate
-
callocStack
public static CGPoint callocStack(MemoryStack stack)
Returns a newCGPoint
instance allocated on the specifiedMemoryStack
and 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.Buffer
instance allocated on the thread-localMemoryStack
.- Parameters:
capacity
- the buffer capacity
-
callocStack
public static CGPoint.Buffer callocStack(int capacity)
Returns a newCGPoint.Buffer
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.- Parameters:
capacity
- the buffer capacity
-
mallocStack
public static CGPoint.Buffer mallocStack(int capacity, MemoryStack stack)
Returns a newCGPoint.Buffer
instance 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.Buffer
instance allocated on the specifiedMemoryStack
and 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
.
-
-