-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4080e39
commit ebabb02
Showing
9 changed files
with
30,211 additions
and
34,484 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
#define RAYGUI_IMPLEMENTATION TRUE | ||
#include "../raylib/src/raylib.h" | ||
#include "../raylib/src/rlgl.h" | ||
#include "../raylib/src/raymath.h" | ||
#include "../raylib/src/raylib.h" | ||
#include "../raygui/src/raygui.h" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,219 @@ | ||
// Generated by jextract | ||
|
||
package org.vybe.raylib; | ||
|
||
import java.lang.invoke.*; | ||
import java.lang.foreign.*; | ||
import java.nio.ByteOrder; | ||
import java.util.*; | ||
import java.util.function.*; | ||
import java.util.stream.*; | ||
|
||
import static java.lang.foreign.ValueLayout.*; | ||
import static java.lang.foreign.MemoryLayout.PathElement.*; | ||
|
||
/** | ||
* {@snippet lang=c : | ||
* struct GuiStyleProp { | ||
* unsigned short controlId; | ||
* unsigned short propertyId; | ||
* int propertyValue; | ||
* } | ||
* } | ||
*/ | ||
public class GuiStyleProp { | ||
|
||
GuiStyleProp() { | ||
// Should not be called directly | ||
} | ||
|
||
private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( | ||
raylib.C_SHORT.withName("controlId"), | ||
raylib.C_SHORT.withName("propertyId"), | ||
raylib.C_INT.withName("propertyValue") | ||
).withName("GuiStyleProp"); | ||
|
||
/** | ||
* The layout of this struct | ||
*/ | ||
public static final GroupLayout layout() { | ||
return $LAYOUT; | ||
} | ||
|
||
private static final OfShort controlId$LAYOUT = (OfShort)$LAYOUT.select(groupElement("controlId")); | ||
|
||
/** | ||
* Layout for field: | ||
* {@snippet lang=c : | ||
* unsigned short controlId | ||
* } | ||
*/ | ||
public static final OfShort controlId$layout() { | ||
return controlId$LAYOUT; | ||
} | ||
|
||
private static final long controlId$OFFSET = 0; | ||
|
||
/** | ||
* Offset for field: | ||
* {@snippet lang=c : | ||
* unsigned short controlId | ||
* } | ||
*/ | ||
public static final long controlId$offset() { | ||
return controlId$OFFSET; | ||
} | ||
|
||
/** | ||
* Getter for field: | ||
* {@snippet lang=c : | ||
* unsigned short controlId | ||
* } | ||
*/ | ||
public static short controlId(MemorySegment struct) { | ||
return struct.get(controlId$LAYOUT, controlId$OFFSET); | ||
} | ||
|
||
/** | ||
* Setter for field: | ||
* {@snippet lang=c : | ||
* unsigned short controlId | ||
* } | ||
*/ | ||
public static void controlId(MemorySegment struct, short fieldValue) { | ||
struct.set(controlId$LAYOUT, controlId$OFFSET, fieldValue); | ||
} | ||
|
||
private static final OfShort propertyId$LAYOUT = (OfShort)$LAYOUT.select(groupElement("propertyId")); | ||
|
||
/** | ||
* Layout for field: | ||
* {@snippet lang=c : | ||
* unsigned short propertyId | ||
* } | ||
*/ | ||
public static final OfShort propertyId$layout() { | ||
return propertyId$LAYOUT; | ||
} | ||
|
||
private static final long propertyId$OFFSET = 2; | ||
|
||
/** | ||
* Offset for field: | ||
* {@snippet lang=c : | ||
* unsigned short propertyId | ||
* } | ||
*/ | ||
public static final long propertyId$offset() { | ||
return propertyId$OFFSET; | ||
} | ||
|
||
/** | ||
* Getter for field: | ||
* {@snippet lang=c : | ||
* unsigned short propertyId | ||
* } | ||
*/ | ||
public static short propertyId(MemorySegment struct) { | ||
return struct.get(propertyId$LAYOUT, propertyId$OFFSET); | ||
} | ||
|
||
/** | ||
* Setter for field: | ||
* {@snippet lang=c : | ||
* unsigned short propertyId | ||
* } | ||
*/ | ||
public static void propertyId(MemorySegment struct, short fieldValue) { | ||
struct.set(propertyId$LAYOUT, propertyId$OFFSET, fieldValue); | ||
} | ||
|
||
private static final OfInt propertyValue$LAYOUT = (OfInt)$LAYOUT.select(groupElement("propertyValue")); | ||
|
||
/** | ||
* Layout for field: | ||
* {@snippet lang=c : | ||
* int propertyValue | ||
* } | ||
*/ | ||
public static final OfInt propertyValue$layout() { | ||
return propertyValue$LAYOUT; | ||
} | ||
|
||
private static final long propertyValue$OFFSET = 4; | ||
|
||
/** | ||
* Offset for field: | ||
* {@snippet lang=c : | ||
* int propertyValue | ||
* } | ||
*/ | ||
public static final long propertyValue$offset() { | ||
return propertyValue$OFFSET; | ||
} | ||
|
||
/** | ||
* Getter for field: | ||
* {@snippet lang=c : | ||
* int propertyValue | ||
* } | ||
*/ | ||
public static int propertyValue(MemorySegment struct) { | ||
return struct.get(propertyValue$LAYOUT, propertyValue$OFFSET); | ||
} | ||
|
||
/** | ||
* Setter for field: | ||
* {@snippet lang=c : | ||
* int propertyValue | ||
* } | ||
*/ | ||
public static void propertyValue(MemorySegment struct, int fieldValue) { | ||
struct.set(propertyValue$LAYOUT, propertyValue$OFFSET, fieldValue); | ||
} | ||
|
||
/** | ||
* Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. | ||
* The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} | ||
*/ | ||
public static MemorySegment asSlice(MemorySegment array, long index) { | ||
return array.asSlice(layout().byteSize() * index); | ||
} | ||
|
||
/** | ||
* The size (in bytes) of this struct | ||
*/ | ||
public static long sizeof() { return layout().byteSize(); } | ||
|
||
/** | ||
* Allocate a segment of size {@code layout().byteSize()} using {@code allocator} | ||
*/ | ||
public static MemorySegment allocate(SegmentAllocator allocator) { | ||
return allocator.allocate(layout()); | ||
} | ||
|
||
/** | ||
* Allocate an array of size {@code elementCount} using {@code allocator}. | ||
* The returned segment has size {@code elementCount * layout().byteSize()}. | ||
*/ | ||
public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { | ||
return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); | ||
} | ||
|
||
/** | ||
* Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). | ||
* The returned segment has size {@code layout().byteSize()} | ||
*/ | ||
public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer<MemorySegment> cleanup) { | ||
return reinterpret(addr, 1, arena, cleanup); | ||
} | ||
|
||
/** | ||
* Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). | ||
* The returned segment has size {@code elementCount * layout().byteSize()} | ||
*/ | ||
public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer<MemorySegment> cleanup) { | ||
return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); | ||
} | ||
} | ||
|
Oops, something went wrong.