Mac Support Complete!

Fri 17 Nov 2017

Author: Lucas Fraser

Well, after quite a lot of fussing around I finally managed to sort out the Mac support for First Light. As Sam mentioned in his previous post we updated our image loading to use the new STB bindings provided by LWJGL3, which fixes some major thread hanging issues caused by using AWT with GLFW (especially on MacOS).

After the image loading was fixed, the game didn't core dump, which was one step closer to getting the mac support working. After some more issues relating to the shader code (on mac you cant write 2f for instance, you have to write 2.0f or just 2), were were one more step closer. The game would run, and was actually working, but there was only a black screen being rendered.

Queue a few hours of tracing OpenGL errors with glGetError(), and we found the problem to be in the chunk VBOs. Now since on the make we have to request a strict 3.3 core profile, we are not allowed to use the deprecated functions. One of which was GL_QUADS as our VBO drawing method. Changing this to proper triangles resolved the issue and hence Mac support is complete. The change to standard triangles wasn't such a simple task due to having to modify the VBO creation and Lighting to work with the extra verticies, but that is something Sam will discuss in his next post.

 

Back to blog