Recent posts

#11
Bug Reports / RFE / Re: [BUG] Double free on Point...
Last post by spasi - January 09, 2025, 12:29:49
Hey KGAFT,

The name of this method is meant as a hint that it uses ByteBuffer.allocateDirect internally, which allocates a GC-managed ByteBuffer. The free method has this javadoc:

QuoteFrees the buffer allocation.

This method should not be used if the memory backing this buffer is not owned by the buffer.
All MemoryUtil methods that allocate explicitly-managed memory have the following note (or similar):

QuoteMemory allocated with this method must be freed with memFree.
ByteBuffer.allocateDirect, PointerBuffer.allocateDirect, BufferUtils methods and MemoryStack methods do not have such a note because, well, you don't have to do anything special to deallocate the returned buffer.

You may read Memory management in LWJGL for more details.
#12
Bug Reports / RFE / [BUG] Double free on PointerBu...
Last post by KGAFT - January 09, 2025, 10:26:18
During development of my vulkan app with lwjgl, i noticed there are a lot of glibc errors like: double free detected in tcache. After continuously investigation, i found out that all PointerBuffer object allocated through allocateDirect are garbage collected automatically, with no need to free it manually, despite there existing free method. There is need to do something with this, add notice to docs, or make this method private.

P.S: You can repeat it by running this code, and specify the memory limit for java vm:
while(true){
    PointerBuffer pb = PointerBuffer.allocateDirect(9999);
    pb.free();
}
#13
Bug Reports / RFE / Re: Unusual Window / Startup /...
Last post by spasi - January 08, 2025, 19:10:48
Hey Ir3n!cus,

If the Raspberry defaults to Wayland, then that's the most likely problem. LWJGL versions before 3.3.5 always used GLX by default. With 3.3.5, Wayland is detected automatically and LWJGL switches to EGL internally.

If you cannot update to 3.3.5+, a workaround is possible. Add the following before init:

if (glfwGetPlatform() == GLFW_PLATFORM_WAYLAND) {
    Configuration.OPENGL_EXPLICIT_INIT.set(true);
    GL.create(EGL.getFunctionProvider());
}
#14
Lightweight Java Gaming Library / Re: LWJGL 3.3.5
Last post by cpope9141 - January 07, 2025, 15:09:03
Great! Thank you!
#15
Bug Reports / RFE / Unusual Window / Startup / Tas...
Last post by Ir3n!cus - January 07, 2025, 10:05:13
I try to develope a java application with LibGdx for Raspberry 4. The Raspberry runs the standard OS.
For short debug cycles I ran this application during developement mostly on windows and only deploy it to the raspberry after bigger features are complete.

I want the app to get a "Taskbar-Item" and to start in fullscreen mode. Since both happends on windows, i would assume I configured the app internal settings correct.

On the raspberry there are two problems.
  • The app starts minimized / iconified. There is no visual window on the desktop.
  • The app gets no "Taskbar-Item". There is no "clickable instance" on the desktop to bring the app to front.

I already opened a thread to the second problem in the raspberry forum, but got no answer:

Raspberry Forum Post

My main problem is, that I cannot figure out the root cause and the element to take care of.
What participates on this problems and must be changed?
  • Java Runtime Environment?
  • LibGdx?
  • LWJGL?
  • OpenGL?
  • Wayfire?
  • Wayland?
  • LabWC?
  • mf-panel-pi?
  • ..... ?

The only point I can say is that this does not happend with a selfmade Java-Swing-Gui-App to test this.
The swing app gets a Taskbar-Item and the window show up on startup normally.
And all other applications like the raspberry terminal app getting window and taskbar-item, too

This seems to happend only with LibGdx/LWJGL - Java - Appllications.
#16
Lightweight Java Gaming Library / LWJGL 3.3.6
Last post by spasi - January 06, 2025, 23:39:49
LWJGL 3.3.6 has been released!

Release notes
Download
#17
Lightweight Java Gaming Library / Re: LWJGL 3.3.5
Last post by spasi - January 06, 2025, 23:38:23
Hey cpope9141,

LWJGL 3.3.6 has been released, which seems to not suffer from the same problem.

The issue started with 3.3.4, which was the first release to use Clang-CL to build the Windows binaries. With 3.3.6 we have reverted back to MSVC and it looks like the false positives have been eliminated.
#18
Lightweight Java Gaming Library / Re: Indie Fighting Game using ...
Last post by cpope9141 - December 23, 2024, 00:57:38
The December release of Area Zero (v0.20.0) is now available:
https://ephemeraltechnicalarts.com/area-zero

#19
Lightweight Java Gaming Library / Re: LWJGL 3.3.5
Last post by cpope9141 - December 23, 2024, 00:55:43
Has anyone else reported a security threat from lwjgl-stb-natives-windows.jar ?

Windows Security reported this threat when I copied over files from the 3.3.5 custom zip from the download page:

Detected: Trojan:Script/Phonzy.B!ml
Status: Quarantined
...
Date: 12/22/2024 6:47 PM
Details: This program is dangerous and executes commands from an attacker.
#20
OpenGL / Null Context : OpenGL integrat...
Last post by bolivar - December 16, 2024, 22:22:52
Hello everyone,

I am trying to use an OpenGL canvas in SWT with Zulu 17 on Mac Aarch64.

To do so, I relied on the provided example SWTDemo but I got the following exception:

Exception in thread "main" java.lang.NullPointerException: Cannot invoke "org.eclipse.swt.internal.cocoa.NSGraphicsContext.saveGraphicsState()" because "context" is null
   at org.eclipse.swt.widgets.Widget.drawRect(Widget.java:763)
   at org.eclipse.swt.widgets.Canvas.drawRect(Canvas.java:170)
   at org.eclipse.swt.widgets.Display.windowProc(Display.java:6124)
   at org.eclipse.swt.internal.cocoa.OS.objc_msgSendSuper(Native Method)
   at org.eclipse.swt.widgets.Display.applicationNextEventMatchingMask(Display.java:5398)
   at org.eclipse.swt.widgets.Display.applicationProc(Display.java:5802)
   at org.eclipse.swt.internal.cocoa.OS.objc_msgSend(Native Method)
   at org.eclipse.swt.internal.cocoa.NSApplication.nextEventMatchingMask(NSApplication.java:92)
   at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3877)
   at com.afp.iris.mpvlab.SwtDemo.main(SwtDemo.java:158)

Has anyone encoutered this issue ? If so I will very appreciate any tips or workaround.

Thank you

Bolivar