Move Milkdrop-specific shader code into MilkdropPreset, only keep generic and potentially reusable stuff in Renderer.
Also adding some abstraction to reduce the number of direct OpenGL calls to make it easier to add other rendering APIs in the future.
Requires a general rewrite of the Milkdrop preset code. Previous implementation was tightly integrated into the code parser, so reusing this code wasn't possible. Additional refactoring was done, finished converting custom wave/shape implementations to use the new expression parser code.
Other changes:
- Renamed Parser to OldParser to make it clear this is going away.
- Removed all the useless "unit tests" which did not actually test anything.
- Added a new GTest-based test executable that can be run with CMake's CTest.
- Added unit tests for the new fileParser class, including test files.
$ git grep -l 'include "libprojectM/' | xargs sed 's,include "libprojectM/,include "projectM-4.0/,' -i
And then revert for src/libprojectM/*.hpp includes:
$ for i in $( cd src/libprojectM && ls -1 *.hpp ) ; do grep -Rl "#include \"projectM-4.0/${i}\"" | xargs -r sed "s,\"projectM-4.0/${i},\"libprojectM/${i}," -i ; done
Now projectm_create() will just return a NULL pointer instead of having the runtime library call SIGABRT.
In a later iteration, we may allow creation of the instance and just keep the renderer uninitialized. Users should then call a to-be-introduced renderer reinitialization function.
Target name is now just libprojectM::projectM for the main library instead of libprojectM::static or libprojectM::shared.
Now using CMake's default mechanism to select the resulting library type via the BUILD_SHARED_LIBS variable. Main use case will be working with the shared library, which is the default.
Playlist library now also builds as a shared library, including proper symbol exports.
Additionally, deleted the leftover TestRunner class and a few old and rather useless test cases.
Also added LLVM find_package call and as a link dependency if the build is configured for using (experimental) LLVM code.
Reorganized tests to link either one of the object libraries for unit testing.
There's still a sudden change between presets halfway through the transitions as the shaders are swapped, but fixing this would require a larger rewrite of how presets are rendered in the pipeline. Will do this later.
Mesh size is currently so deeply burrowed in the whole preset structure that changing it on the fly is basically impossible. For now, we'll reload the idle preset and reset the whole preset factory class tree to make sure all classes are properly reinitialized. If apps want to change the mesh size after startup, they need to reload the last played preset after changing the mesh size. This will be fixed in the future after the parser/equation compiler rewrite.
Was only possible on startup before, changing the paths required recreating the whole projectM instance. Now, the method will only reset the texture manager, but not the shaders and presets.