Open athaun opened 2 years ago
You may want to try using java.awt.Toolkit.getDefaultToolkit();
before or after initializing glfw, this should remove this message.
That actually results in a black screen and the engine hanging. Interestingly, after researching the issue I found this: Someone who has the same error on apple silicon (which is also applicable to me).
Next I took a closer look at the shader itself. The texture samplers were stored in an array, which is a bit of a special case in GLSL, particularly when it comes to OpenGL 3. All accesses to the sampler array must use compile-time fixed indices. I was using a switch statement to branch out uses of every possible index, and this has been working fine on various OpenGL drivers so far. The shader was responding correctly to if statements, though, so eventually I decided to replace the switch statements with a series of ifs. Functionally these are supposed to be equivalent, but to my surprise it fixed the problem! from https://blog.dengine.net/2021/01/wonders-and-mysteries-of-the-m1/
I will investigate some more with a windows or linux machine to see if the error arises, if not, I will assume it is either mac OS and or m1 architecture specific. I will also see if using a if/else ladder resolves the issue.
Likely apple silicon
Warning when running some scenes on mac OS.
Reason for this is unknown right now, this issue is mostly a reminder for myself to debug it. Possibly a result of
System.setProperty("java.awt.headless", "true");
on L. 139 in graphics.Window