Spellcaster Studios

Make it happen…

Never according to plan…

As I said yesterday, I’m currently using GLFW to help me in the future to port the game from Windows to Linux and Mac…

Of course, nothing goes according to plan…

Problem number 1: I thought I could use GLFW to handle all the window/keyboard/mouse events, both in OpenGL and DirectX, but that is not true… GLFW takes care of the OpenGL contexts and creates one for every window it creates, so I can’t use it with DirectX, which is too bad… That’s not too serious, I just have to add a “translation” between Win32 and GLFW messages.

Problem number 2: It was very hard to get rendering work… After a lot of debugging, testing, tweaking, comparison, and general snooping in the GLFW code, I finally found out that my OpenGL context (created by hand) was a 3.2 with backwards compatibility, while the OpenGL context generated by GLFW was a 3.2 without backwards compatibility and forward compatibility… Of course, part of this was my fault, I totally forgot I had the context generated with backwards compatibility (because I’m making GLSL 1.4 shaders, so I can pass them through the glsl_optimizer that can’t handle GLSL 1.5 shaders), but the API could be a bit more expressive in terms of errors… It also doesn’t help that gDebugger crashes because of a glDeleteShader command that doesn’t seem to have anything wrong with it…

All in all, this only solidifies my opinion that OpenGL as an API is a mess… It has too many things that can go wrong without any significant debug/error output, and setting up the contexts (without external libraries) is part of the problem…

screen645

The way this is setup currently, I have zero confident that this will work under Linux/Mac, since I don’t know if they’ll provide me with a compatibility context… If not, I’ll have to write all shaders in GLSL 1.5, and optimize them by hand, which is very hard to do with my system that uses über-shaders to generate all permutations!

Next step is to get the input working on GLFW, so stay tuned!

Now listening to “Tales from the Kingdom of Fife” by “Gloryhammer”

Link of the Day: Still on the E3 stuff, I liked the art-style and general concept of this one:

Next step is getting all the input working with GLFW…

Comment