Thoughts about graphics backend for Redkite

These days started to add new functionality to Redkite GUI toolkit for Windows API, i.e. to make RkPainter to work also on Windows platform and be able to build Geonkick synthesizer for VST3. Since Redkite is using Cairo backend for graphics on X11, there is no need to make any changes in order to enable this also on Windows, Cairo is cross-platform. Only what I need is to compile statically Cairo and link. One problem I see is that Cairo adds new complexity when it comes to build because it depends on several other libraries like zlib, libpng, pixman etc. On GNU/Linux it is easier to compile statically, but anyway this adds more steps in general. Now when someone compiles Redkite on GNU/Linux it uses there Cario shared library. Ideally this should be linked statically because this is one of the requirements of Redkite not to add dependencies that prevents easily Redkite to be linked statically, also this may create problems of versioning, but Cario on GNU/Linux it can be considered a non issue regarding versions of Redkite running in the same address space at this time for my goals. On Windows is more problematic.

I want Redkite to be small and focused, and provide easy to use, and to keep it goals in solving problems regarding GUI toolkit for plugins. Due to this I started to have a feeling there is a need to use OpenGL or Direct2D instead of Cario for Windows to reduce the number of dependences and complexity when building and linking. Cairo on Windows it seems to use GDI (it can use also OpenGL). OpenGL or Direct2D are provided with the system.

Now the internal design of Redkite is that I can change easily graphics backends with a preprocessor macro, there is a need only to develop the implementation class that uses OpenGL or Direct2D instead. For GNU/Linux Cairo will be used, even on GNU/Linux can be reduced but I am not sure for now if it is necessary, I’ll see. OpenGL is first candidate for this goal because is cross-platform.

For now I’d like to use Cairo for both platforms. I have started to build statically Cairo for Windows and hope to get it easy. If no, than I’ll start to implement the backend for Windows that uses most likely OpenGL. This will delay a little VST3 plugin version for Geonkick synthesizer, but I want more quality regarding implementation. RkPainter now that was used for Geonkick still don’t have big interface in order to be implemented with Direct2D or OpenGL, probably there will not be much to code.