Closed mudlee closed 7 years ago
Haha, right after I wrote the issue, found a GLFW issue: https://github.com/LWJGL/lwjgl3/issues/68
The last two comment the point there. I recommend to update this chapter for OSX users, because it caused a headache to me :D
BTW, if I put headless option to my code, I get this:
2016-12-09 20:30:14.114 java[37849:1780730] [JRSAppKitAWT markAppIsDaemon]: Process manager already initialized: can't fully enable headless mode.
Many thanks. I will certainly update the capter with that information. One question, even with the warning, are you able to run the sample when headless ?
Actually, I don't run the samples, I just copy some of the code. But headless doesn't solve all the problem :(
Hm, my bad, but just got home, and checked again. It works, I can see the DEMO text, but got a warning in the console:
2016-12-12 17:36:56.488 java[43596:2125681] [JRSAppKitAWT markAppIsDaemon]: Process manager already initialized: can't fully enable headless mode.
BTW, I keep going so if I face with bugs or strange thinks like this, I'll definetly report them :)
Glad to hear that. Then it seems to be consistent with what's decsribed in this thread. It seems that AWT messes with the main thread in OSX, which is also required by GLFW. When a Font is created, AWT is initialized. The fact that it's created after GLFW allows to be executed in headless mode. Anyway, the recommended approach seems to use the stb library.
Thus, in the short term I will include the workaround in the book. In the ling term I will check if I cand generate texts with stb library.
Many thanks for isolating the problem ! Unfortunately I dont't own a Mac so I cannot test the samples for that platform.
Yeah, my pleasure! :) It's a happy accident that I have a mac, so you can get feedbacks on that platform too.
BTW, I found an another typo(?) in the Renderer class in the skybox chapter.
You cannot run this:
viewMatrix.m30(0); viewMatrix.m31(0); viewMatrix.m32(0);
You have to use this way:
viewMatrix.m30 = 0; viewMatrix.m31 = 0; viewMatrix.m32 = 0;
Should I collect everything and report in one issue at the end, or as I progress, I should create issues? What do you prefer?
I'd rather prefer a separate issue that groups all the typos you find.
Many thanks.
My suggestion is that you should open a new issue about removing AWT use. I will try to remove it as soon as I can, Regarding the BufferedImage I guess I can use the stb lib and for the Toolkit some GLW methods. Unfortunatley I also don't own a Mac, so I depend on the people that own them to report issues.
2016-12-15 18:57 GMT+01:00 Muranyi Sandor notifications@github.com:
@lwjglgamedev https://github.com/lwjglgamedev actually I started to write a new issue, but it seems it's more complicated then I thought on OSX. I always face with the same problem with AWT. As I see, we should never ever use AWT with LWJGL if we want to run our game on OSX.
The current issue I faced with in the chapter 14 is that ImageIO.read returns a BufferedImage which is in the java.awt package. If I use headless property, I get the same exception as before: 2016-12-15 18:50:58.720 java[55477:2795656] [JRSAppKitAWT markAppIsDaemon]: Process manager already initialized: can't fully enable headless mode.. If I don't use headless, then I get a black empty screen again. Same story with Toolkit.getDefaultToolkit().getScreenSize().
As I see now, this tutorial is not ready to use on OSX, because of using java.awt package. Though, I very much love to continue learning, but this is almost the only one good and up2date tutorial available.
What is your suggestion @lwjglgamedev https://github.com/lwjglgamedev, what should I do? Unfortunately I don't own a PC :(
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/lwjglgamedev/lwjglbook/issues/17#issuecomment-267395980, or mute the thread https://github.com/notifications/unsubscribe-auth/ANlzJw84LCnyASZ7Djj5tpsJgFd6v-WXks5rIX90gaJpZM4LJQ_3 .
Ok,
I've just removed AWT usage form height map and window dimensions. The only thing left is text rendering (Font). I'm making the changes over chapter 14. So, the plan is, to upload a new version of chapter 14 so you can check if everything works as expected on OSX. If so, I will modify the whole code base and the book contents.
Let me know of this is ok to you.
Good plan, waiting for the updates :)
I'm still struggling to see how to use stb for fonts. In the meantime, I've uploaded chapter 14 removing the use of AWT for height maps and screen size. If you can live with this I can apply the changes to the remaining chapters so you ar enot blocked.
I can definetly live with that. As the guys wrote on the lwjgl forum, glfw may solve this in the future. In the meantime we get a warning and that's all.
I think I've just remoed AWT usage except for the fonts. I've manged to load fonts with STB but I?m not quite satsified of the results, so, by now, I will leave the font rendering as it is.
OK. I think you can close this issue now, thanks for the quick response and the great solution! In the future, you would be good if you can check out nifty-gui and alternatives, not "just" STB. BTW, I'll need stb in the near future, so if I managed to use STB, I'll get back to you.
Although the issue is closed, You can check the source code for chapter 24, it uses NanoVG for text rendering. It may help you.
I will. First, I'd like to finish this tutorial along with ThinMatrix's youtube tutorial, then do some refactor and start my first game. If I find something that can improve something already exists in this tutorial, I'll get back to you. For eg.: on osx I have an interesting issue if I use fullscreen mode, only the small part of the window is used to render the scene. I'll check that out next week.
BTW, I just read that LWJGL now supports Yoga. And what about nifty gui? Why did you choose nano?
It's a simple library to use and it was requested by some of the readers. There are meny other, nuklear, ninfty gui (as you mention), but I do not pretend to cover all of them.
Hi. I'm here again... :)
Just finished the chapter12 with a lot debugging, because at the end, I got just a simple black screen, without any error. Even the ESC or any key input was not working.
Hours later, I've found that I get the black screen, when I initialize the FONT variable in the Hud.java. Tried lots of differents things, but got black screen if I write this line down to anywhere:
new Font("Arial", Font.PLAIN, 20);
Any idea why it brakes on osx?