Commit Graph

105 Commits

Author SHA1 Message Date
2b41fa256a Let developers provide an optional filename for dumping main texture contents. 2023-01-25 14:22:19 +01:00
d7528f7e2e Pass new TextureManager pointer to ShaderEngine after resetting it. 2023-01-07 15:52:50 +01:00
48f291b51c Removed config file support and added temp fix for mesh size change.
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.
2023-01-07 15:52:50 +01:00
bbfc4f7170 Added API method for (re)setting texture search paths.
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.
2023-01-07 15:52:50 +01:00
22b0ccc423 Removed some unused offset parameters in Renderer methods. 2023-01-07 15:52:46 +01:00
6485ec40fb Removed unused include in Renderer.cpp that made the build fail. 2022-12-04 22:26:42 +01:00
2b1099a653 Implement external preset switching control and add stream loading support.
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.
2022-11-21 19:56:30 +01:00
cb0bbfa860 Removed all text-related code from the core lib.
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.
2022-09-20 22:46:03 +02:00
972b911e75 BeatDetect/Render: Fix -Wshadow warnings
Rename the variables to avoid shadowing local variables and class
members.

Also changed some spaces to tabs for local consistency.
2022-09-15 16:57:40 +02:00
5ff183834e Don't copy texture search paths in Renderer/TextureManager
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.
2022-09-09 00:45:59 +02:00
66380727b2 Create texture search path list in ProjectM class, pass it to TextureManager. 2022-09-09 00:45:58 +02:00
788a5ecaac Class Renderer: Store TextureManager instance as unique_ptr for easier memory management 2022-09-09 00:45:58 +02:00
6906d4ed60 Class Renderer: Renamed members, removed more unused ones. 2022-09-09 00:45:58 +02:00
33523ffe63 Class Renderer: Made internally used member private, removed a few unused members. 2022-09-09 00:45:58 +02:00
1e25e2119c Removed unused "interface" enum. 2022-06-06 18:50:50 +02:00
3ff81ad574 Remove unnecessary dependents 2022-05-29 15:29:54 +02:00
c6078b7887 More shape and wave rendering fixes. 2022-03-29 12:11:21 +02:00
1ee932a23c Refactored default waveform math and drawing.
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.
2022-03-29 12:11:21 +02:00
b761540eb2 Fixed shapecode outline rendering to match Milkdrop logic.
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).
2022-03-29 12:11:21 +02:00
76a83db1a8 Split Renderable.hpp/.cpp into separate files.
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.
2022-03-29 12:11:21 +02:00
7bd188246f Added four missing built-in equation parameters.
Also use smoothing parameter in spectrum waveforms and the same aspect ratio values in both equation and shader code.
2021-11-25 21:43:46 +01:00
5cf41fff63 Improve overlay text rendering performance and a few Renderer cleanups.
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.
2021-11-25 21:41:43 +01:00
875e3a0674 Removed unused includes.
sys/select.h introduced in a recent PR isn't available on Windows, failing the build while not being used at all.
2021-11-05 23:37:23 +01:00
e2d265f038 Issue#130 (#546)
* 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 fixes projectM-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
2021-10-23 22:22:49 +03:00
0a4cf9fa49 Added getters and setters for all settings values and renamed some members.
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.
2021-08-23 18:37:57 +02:00
61b1646b24 Minor menu changes (#490) 2021-06-19 16:46:07 +03:00
4184f237bd Added case-insensitive search
Fixed Windows Debug build
2021-04-08 11:26:05 +03:00
b8fc74ad3f Crash fix when using multiple renderers (do not use static currentPipe) (#428)
Co-authored-by: djdron <djdron@gmail.com>
2020-12-08 18:36:39 +02:00
fd1d235a05 Fix various warnings (#436)
* Fix Wreorder warnings

* Fix various unused variable/parameter warnings

* Fix Wparentheses warnings

* Fix Wignored-qualifiers warning

* Fix uninitialized variable warnings

* Fix Wshadow warnings

* Fix Wsign-compare warnings

* Fix miscellaneous warnings
2020-11-26 11:05:40 +02:00
977e732513 refactor highlighting into it's own method 2020-09-01 10:20:27 +04:00
05d41d21af reset search function, and start to handle / key 2020-09-01 10:20:27 +04:00
15230781e1 comments 2020-09-01 10:20:16 +04:00
34bc6746a3 draw search & highlight search text. 2020-09-01 10:19:21 +04:00
c80533c947 Merge branch 'master' into touch 2020-08-31 20:53:06 +04:00
a0dc91231d review requests by @revmisha 2020-08-31 20:51:25 +04:00
7c8059f408 Help Menu 2020-08-08 14:27:28 +04:00
5c89399872 Help Menu 2020-08-08 14:22:30 +04:00
001d58843e Prioritize toasts; pass color to drawText; determine max lines on reset of renderer; draw preset menu 2020-08-07 15:49:52 +04:00
c9b1f5fa71 Disable lines again 2020-07-15 21:04:29 +04:00
c7fcaea3b2 New vision for touching 2020-07-15 20:59:37 +04:00
a7f58984da Right click destroys the waveform you placed on the renderer with left click. 2020-07-14 23:14:10 +04:00
734d01e031 Touch now supports dragging (wave more fun than just clicking). 2020-05-26 13:38:50 +04:00
60ba92e552 Merge branch 'master' into touch 2020-05-24 19:13:11 +04:00
5b18d21de5 Not needed. 2020-05-24 18:37:57 +04:00
5074405c7b Less random colours (less ugly) + better documentation on touch. 2020-05-24 18:12:42 +04:00
cdd52d3a57 Touch support for renderer. 2020-05-24 17:44:11 +04:00
1d994941ef Help menu (#357)
* beatfix

* Flexible help menu

* SDL set help menu.
2020-05-24 11:31:02 +03:00
43c294791a beatfix (#355) 2020-05-15 21:00:54 +03:00
366a70b678 beatfix 2020-05-15 21:45:09 +04:00
9760ae934f Implement toast messages (#351)
* Bette

* Removing test message.

* New timing functions. Handle drawing text that's too big.

* SDL space and switch libprojectM to use setPresetLock for L.
2020-05-14 22:08:50 +03:00