BufferedImage Causes Crash Only in LWJGL Project

Started by CJ Burkey, June 06, 2017, 02:13:38

Previous topic - Next topic

CJ Burkey

This problem may not be LWJGL, but it only occurs when it is present. I'm experiencing something really strange, and I don't know what's causing it at all. This is the problematic line of code:
BufferedImage out = new BufferedImage(256, 256, BufferedImage.TYPE_INT_RGB);

This code can be called anywhere, in any thread, and instantly all threads freeze. If it is called before GLFW is bound, the thread doesn't freeze, everything gets called, but the GLFW window never opens. Note: I am using Mac, so I have
-XstartOnFirstThread
as a JVM argument, but I don't think that would cause it.

Actually, it is not related to that argument, it runs perfectly fine with and without it in another test project without LWJGL.
- A partial, semi-half game developer

spasi


CJ Burkey

Quote from: spasi on June 06, 2017, 04:33:28
See this reply.

I did end up finding a solution to the problem here: https://stackoverflow.com/questions/44379870/java-creating-instance-of-bufferedimage-freezes-program. As long as I don't use it before GLFW is initialized, with that JVM argument, it works well.
- A partial, semi-half game developer

orange451

You should try to migrate away from BufferedImage though. It uses a considerable amount of Memory, and is quite slower than the STB library included with LWJGL3