A work-in-progress free and open-source replacement for the Diablo I engine. Simply import the Diablo assets, and enjoy the same old game with faster performance and modern resolutions, and first class support for mods.

  • OpenGL renderer + no more libRocket + misc stuff

    February 25, 2017 by wheybags

    So, I’ve gotten the main renderer ported to OpenGL instead of using SDL2 (still using SDL2 for input, audio, window + OpenGL context creation, so it’s by no means gone).

    freeablo-opengl

    So different, wow

    The code is still a bit of a mess, and unfortunately libRocket doesn’t work, so there’s no GUI at the moment. If you’re curious, you can see the code here: https://github.com/wheybags/freeablo/pull/250

    Why would you want this? OpenGL lets us use programmable shaders, so we can do fancy lighting effects, instead of just dumping images on top of eachother.

    So, what about the GUI? Well, libRocket hasn’t been working out as fantastically as I had hoped. It is a fairly dead library (there is a guy maintaining it on life support, but it needs much more work), and has problems with memory leaks that are unlikely to get solved. It also uses python as it’s scripting language (actually supports lua now too, but it would be as much work to switch to that as to just dump it), which is kind of just a bad choice for this project.

    I want to allow mod developers to write script code for their mods, so preferably the scripting language would be sandboxed from doing bad things like network and disk I/O, but with python this just in’t possible. As well, the libRocket rcss and rml languages are¬†close enough to html/css that you try to use the tricks you know from that space, but far enough that the tricks don’t work.

    So, I’ve decided that as part of this port, I will just switch GUI library too. The current front-runner is MyGUI, with some custom lua script bindings. This is the gui library used in OpenMW¬†(awesome project, check it out if you haven’t heard of it). A lot of my technical decisions so far have been based on OpenMW, so in a sense this is just following that trend.

    Finally for the programmers reading this, I wanted to plug an awesome utility that I’ve found out about recently, and will definitely be using in freeablo in the future: Hunter

    Hunter is a cmake library that acts as a package manager for c/c++. This is amazing because the most awkward thing about working with these languages is the immense pain involved in getting your code to build and link (especially getting it to build and link on other people’s computers). Hunter solves this problem by downloading the source of the library, building it as a static library and linking it in, all from within a few lines of CMake.

    So, yeah, Hunter is great, use it :p