LWJGL / lwjgl3

LWJGL is a Java library that enables cross-platform access to popular native APIs useful in the development of graphics (OpenGL, Vulkan, bgfx), audio (OpenAL, Opus), parallel computing (OpenCL, CUDA) and XR (OpenVR, LibOVR, OpenXR) applications.
https://www.lwjgl.org
BSD 3-Clause "New" or "Revised" License
4.67k stars 628 forks source link

[Suggestion] MemoryUtil should support primitive arrays for pointers/memAddresses #972

Open Speiger opened 2 months ago

Speiger commented 2 months ago

Description

o/ I was looking into if LWJGL3 can allocate more then Integer.MAX_VALUE with MemoryUtil due to ByteBuffer being limited to said number.

Turns out it can.

But when i looked if you could insert data into it, that was sadly not possible. The only thing you can do is write single bytes/primitive types/pointers.

It would be nice if array copy support could be added both for read and write. Mainly because then you can truly build your data based on pointers and not create the wrapper every single time for fetching/inserting data.

P.s: I know that there are no real pointers in Java/LWJLG3 its just memory addresses.