Main Menu

Recent posts

#51
Bug Reports / RFE / Re: [BUG] Rare and Random cras...
Last post by Lankyware - March 07, 2024, 23:09:43
Oh, I stopped using ByteBuffers. When I call glBufferData() I put in an array of floats. IIRC I did this because for some things in my game, I put new data in before every draw call, and using Buffer objects for that made it GC more often, causing microlags.
#52
Bug Reports / RFE / Re: [BUG] Rare and Random cras...
Last post by spasi - March 07, 2024, 18:16:43
Hey Lankyware,

Does it happen much earlier if you add System.gc() calls (say, once per frame) in your application? It would indicate that a direct ByteBuffer that is still in use is being garbage-collected, and its associated native memory freed, by mistake. Note that a major issue with GC-managed ByteBuffers (allocated with ByteBuffer.allocateDirect or BufferUtils in LWJGL) is that they are not freed unless full GC cycles happen. The JDK uses Cleaner for this, which is a PhantomReference. Weak/soft/phantom reference processing happens during full GC pauses with most GCs. Such pauses are kind of rare on modern JVMs and that can explain unpredictable crashes at a later time.

I hope this helps.
#53
Bug Reports / RFE / [BUG] Rare and Random crashes ...
Last post by Lankyware - March 07, 2024, 12:46:46
Ok so in my indie game, the game will randomly crash like once every 3 hours or so on average. It gives the message: A fatal error has been detected by the Java Runtime Environment. And it makes a log file. I've looked into it a lot and haven't been able to find out what causes this. This article is the closest I've found to an answer: https://inside.java/2020/12/03/crash-outside-the-jvm/
Error log file: https://gist.github.com/dfu1/253cc2f51b372027109dc99604b2c4ed
I've taken a look in the log file, and in the Java frames part it shows there was a call of org.lwjgl.opengl.GL11C.glDrawArrays(III)V.
And in the Internal exceptions, it says there's a java/lang/NoSuchMethodError exception.
I cannot figure out what the cause is, and I don't understand why it would be happening so rarely and randomly.
Any explanations/ideas are welcome.
#54
Lightweight Java Gaming Library / Re: Indie Fighting Game using ...
Last post by cpope9141 - February 19, 2024, 19:19:12
The February release of Area Zero (v0.9.0) is now available for download: https://ephemeraltechnicalarts.com/area-zero

Release Notes:
0.9.0 (02/18/2024)
  1. All characters now have an air special attack. This attack is activated by pressing the special attack button while airborne.
  2. All of Richard's animations are color mapped.
  3. All of Niven's attack animations are color mapped.
  4. Get up animations (wake up) can be canceled into any grounded special attack.
  5. Down specials can now be activated immediately from standing state.
  6. Tutorials improved and expanded to include new attacks and features.
  7. New color palettes added for each playable character.
  8. Wall bounce tweaked to be more consistent.
  9. Fixed sound effect issue related to characters in hit stun.
  10. Fixed linked animation issue.
#55
How do I make a 3d camera in java and lwgl that can look around with mouse and can move around with key binds, like roblox studio's workspace camera.

Cheers, Shreyank6189
#56
OpenGL / how to make a 3d camera in jav...
Last post by shreyank6189 - February 07, 2024, 14:28:37
How do I make a 3d camera in Java and LWGL that can look around with the mouse and can move around with key binds, like Roblox studio's workspace camera? I could also use Opengl with lwjgl

Cheers, shreyank6189  8)
#57
LWJGL Documentation / Re: Moving circle emaple wante...
Last post by spasi - February 02, 2024, 09:08:31
Hey Dmytro,

You can find some fairly advanced demos here: https://github.com/LWJGL/lwjgl3-demos
#58
LWJGL Documentation / Moving circle emaple wanted
Last post by Dmytro - February 02, 2024, 00:02:09
Hello!

I'm pretty new to LWJGL world.
At this moment I installed everything and sucessfully run example from title page.
But I need more complex example to start develop my project.

Ideally it should be a simple application of bouncing ball or similar. Later I will develop a simulation of planets with field of gravity.
The computation engine is ready need only high-performance graphics. I suppose LWJGL is wnat I need.

Thanks and Regrads,
Dmytro.

#59
OpenGL / Re: Error when creating window...
Last post by aerodash - January 25, 2024, 00:10:33
Hello Spasi :)

Thank you very much.
That worked great !
Just added this:
while (!glfwWindowShouldClose(handle)) glfwWaitEvents();
#60
OpenGL / Re: Error when creating window...
Last post by spasi - January 23, 2024, 09:17:45
Hey aerodash,

Please see https://github.com/LWJGL/lwjgl3/blob/master/modules/samples/src/test/java/org/lwjgl/demo/stb/Vorbis.java for a working example of multithreaded UI (i.e. the event loop), rendering and audio.

The recommended approach is to use the main thread for the event loop (with glfwWaitEvents) so that you're always consuming UI events, then spawn secondary thread(s) for rendering and audio. This works nicely on macOS too (where the event loop must always be on the first thread of the process). Rendering never stops, even while dragging the window.