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.
Lots of interconnected changes in this commit:
- Removed unnecessary name/author/filename members all over the place.
- Started using exceptions to deliver preset loading and rendering errors to the topmost ProjectM class.
- Added stream loading methods to factories and the base Preset class.
- Added new events for requesting preset switch and telling the user about loading errors.
- Consolidated preset switching logic in ProjectM class a bit.
This removes:
- "Toast" messages
- The help text
- Statistics
- Preset name and (unimplemented) song title display
- Preset selection list and search menu
Some of the above functionality might later be added as an optional library, in a separate repository and with proper UTF-8 support.
Instead, store a reference to the original vector which is managed by the ProjectM class. This will allow manipulation of the paths after library init.
Also added Milkdrop's wave smoothing algorithm to make the waveforms look less pointy.
Now very closely matches Milkdrop's math and rendering style except some very minor scaling issues.
Will now render wave mode 8 (spectrum) even if not finished/enabled in the original Milkdrop. Also, Milkdrop does for some reason not use the "mystery" parameter to rotate linear waveforms (modes 6-8) even if the source suggests it. projectM will do it, but there are probably no presets that use it purposely.
Also worth noting: The wave_a parameter has no effect in both Milkdrop and projectM. The wave is always drawn fully opaque.
Now uses anti-aliased, 1px lines and draws them four times in a rectangular offset pattern to "fake" a thicker outline.
Needed to pass the actual viewport size into the render context, as the internal texture size value is useless (the target framebuffer is always as large as the viewport).
Moved all declarations and implementations into class-specific files. Makes it easier to find them and creates smaller compilation units.
Added Doxygen comments to all moved classes and reformatted their code.
Fixed a few typos and type/function declarations.
Added default initializers in the headers where needed.
For each line of text, glText was fully reinitialized, which meant that the font texture, vertex and fragment shaders were recompiled and uploaded to the GPU, then destroyed again. This created a huge FPS drop, especially in GLES environments.
Also moved the text rendering into a separate class and cleaned up the initialization of the Renderer class, moving all default values to the header and deleting the default constructor to avoid unwanted effects.
* Fixes issue projectM-visualizer/projectm#130
Adds functionality of writing a rendered frame to file
as requested by the issue https://github.com/projectM-visualizer/projectm/issues/130.
Keyhandler.cpp has been updated to handle the keydown of 'd',
which triggers writeNextFrameToFile to be set to true, which means
at the end of Renderer::FinishPass1 we write the texture contents to file.
Renderer::debugWriteMainTextureToFile() const contains the functionality
of writing the contents of the main texture.
* Addition to commit that fixesprojectM-visualizer/projectm#130
Safe file write, making sure we don't overflow while creating
the filename. If c++20 features was enabled, this could
look so, so much better.
* Added keybinding to README doc
* Formatting
Fixed snake_case to camelCase
Changed delete to delete[]
Turned magic constant to a named variable
Some members and functions were named in different ways, now the naming scheme is a bit more unified. Also changed some types to size_t where negative values don't make sense.
* Bette
* Removing test message.
* New timing functions. Handle drawing text that's too big.
* SDL space and switch libprojectM to use setPresetLock for L.