Commit Graph

870 Commits

Author SHA1 Message Date
ebafd69dfb Create proper pkg-config file for libprojectM_playlist.
Generalized the generator code as a macro. Still a huge mess.
2023-01-24 19:13:07 +01:00
2287172cbb Create proper pkg-config file for libprojectM.
Should now support both static and shared libs, plus adding any other required flags.
2023-01-24 18:49:37 +01:00
bcaf98f2f1 Rename USE_THREADS to PROJECTM_USE_THREADS and export it in the package config file.
PROJECTM_USE_THREADS is only exported if ENABLE_CXX_INTERFACE is ON.
2023-01-24 17:56:12 +01:00
bff9e52c69 Reduce header footprint of optional C++ API files and export C++ symbols properly. 2023-01-24 17:47:39 +01:00
1f33c810b3 Split up API headers into smaller, categorized files.
Also updated copyright and prefixed the render-related function with "opengl".
2023-01-18 12:57:57 +01:00
c6be80a491 GitHub Actions: Update local package lists before installing dependencies. 2023-01-17 18:58:03 +01:00
edbe7455da macOS: Link CoreFoundation framework to the projectM library. 2023-01-17 18:55:23 +01:00
6e795ec632 Only build either shared or static projectM and playlist libraries.
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.
2023-01-13 11:16:27 +01:00
c8077a2145 Partially fix smooth blending.
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.
2023-01-07 15:52:51 +01:00
eb95939419 Clamp preset progress between 0.0 and 1.0 2023-01-07 15:52:51 +01:00
3dcb1f7a56 Fix preset change notification. 2023-01-07 15:52:51 +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
2410adc92e Fix file type string 2023-01-05 07:24:26 -06:00
e659d862b5 Remove built-in key handler and rename two API functions.
Renamed preset lock functions to be in line with all other getter/setter functions regarding their naming scheme.
2022-12-30 15:14:25 +01:00
28340ce32f Revert reordering of shader preprocessing statements.
Position of "shader_body" is reused in the next find call, which was broken because of the changed order.
2022-12-07 23:06:02 +01:00
b585017ba3 Fix a compile issue in emscripten by forward-declaring PipelineContext. 2022-12-06 15:03:10 +01:00
1429b57f87 Build fixes, expose fewer internals in headers by forward-declaring more types. 2022-12-05 11:46:43 +01:00
6485ec40fb Removed unused include in Renderer.cpp that made the build fail. 2022-12-04 22:26:42 +01:00
381fe4f51e Properly initialize idle preset and preset factory. 2022-12-04 21:51:36 +01:00
53ea059ec1 Fixed URL detection in PresetFactory 2022-12-04 21:51:03 +01:00
94ee2a360b Added remaining API functions and preset change callback. 2022-11-21 19:56:30 +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
b23b5ce25c Deleted all playlist-related code from libprojectM.
Note: SDL test UI won't compile after this commit. Will be fixed in a later commit, when the playlist library is done.
2022-11-21 19:56:28 +01:00
d9ea368a0c Add playlist library and first set of API functions. 2022-11-21 19:54:57 +01:00
b6dfb6e195 Moved public API headers into an INTERFACE library 2022-11-21 19:54:56 +01:00
18b032a8ef API: Add missing setter for FPS value.
Also make sure to propagate the changed value to the preset code via the PipelineContext class. Keeping it in the settings struct for now. Storing a dynamic value in settings makes no sense, so it will be removed later.
2022-11-20 16:53:25 +01:00
003e45e9d9 API: Add missing getter for preset duration value. 2022-11-20 16:53:25 +01:00
e9c1a3eaed Removed parameter and fixed return value 2022-10-29 23:00:45 +02:00
6991953a4e Add get and set for beat sensitivy value to API 2022-10-29 23:00:45 +02:00
dbbbc3e591 Added API function for dumping the next frame. 2022-10-23 18:08:53 +02:00
75f802e261 Remove the "d" hotkey for debug image output. 2022-10-23 18:00:00 +02:00
44e664d81a Added missing member initializer.
Was uninitialized and thus saved a debug image on every startup as the boolean value was mostly non-zero.
2022-10-23 17:59:05 +02: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
62cecb36d6 Fix internal texture format again (GLES doesn't support GL_BGRA) 2022-09-20 22:37:19 +02:00
44f51f9fb6 Remove "#pragma comment" which was required for linking psapi.lib on Windows.
Also removed includes of windows.h/unistd.h, as these shouldn't be required anymore in the ProjectM class.
2022-09-18 13:32:58 +02:00
d97feb22f6 Entirely removed native presets.
The native presets did not build anymore due to refactorings, cause other build issues on Windows (e.g. require linking to psapi.lib) and would need a complete makeover anyway.
2022-09-18 13:32:58 +02:00
98b10f5ec6 Fixed a crash when all presets in the playlist have a rating of 0.
In this case, the weighted random chooser would divide by zero, which will cause a crash. In the case this happens, we'll simply use a uniform random distribution as all ratings are equally zero.
2022-09-18 13:32:33 +02:00
5a165f5de8 Parser: use size_t variable where possible
This fixes some -Wsign-compare warnings.
2022-09-16 10:51:00 +02:00
4d2345cd13 MilkdropWaveform: use size_t for loop counter
This fixes a Wsign-compare warning.
2022-09-16 10:51:00 +02:00
db1b02e718 MilkdropWaveform: remove unused private variable 2022-09-16 10:51:00 +02:00
2805459021 MenuText: use correct forward declaration
The external gltext.h is C, thus forward declare GLTtext as a struct
instead of a class.

In file included from /projectm/src/libprojectM/Renderer/MenuText.cpp:7:
/projectm/src/libprojectM/Renderer/../gltext.h:108:9: warning: struct 'GLTtext' was previously declared as a class; this is valid, but may result in linker errors under the Microsoft C++ ABI [-Wmismatched-tags]
typedef struct GLTtext GLTtext;
        ^
/projectm/src/libprojectM/Renderer/MenuText.h:9:7: note: previous use is here
class GLTtext;
      ^

In file included from /projectm/src/libprojectM/Renderer/MenuText.cpp:7:
/projectm/src/libprojectM/Renderer/../gltext.h:211:1: warning: 'GLTtext' defined as a struct here but previously declared as a class; this is valid, but may result in linker errors under the Microsoft C++ ABI [-Wmismatched-tags]
struct GLTtext {
^
/projectm/src/libprojectM/Renderer/MenuText.h:9:1: note: did you mean struct here?
class GLTtext;
^~~~~
struct
2022-09-16 10:51:00 +02:00
4805790900 Shape: add missing override 2022-09-16 10:51:00 +02:00
9c8e412cdb Replace broken WIN32 checks with _WIN32
CMake defines WIN32 by default on Windows, but we shouldn't rely on it.
_WIN32 is defined by all compilers targeting Windows.

Also cleaned up some header includes.
2022-09-16 10:47:56 +02:00
4cf04e6f66 Remove unused WIN32 ifdefs 2022-09-16 10:47:56 +02:00
2e9d0aaafe Expr.cpp: use _MSC_VER instead of WIN32
CMake defines WIN32 by default on Windows, but we shouldn't rely on it,
as it is also defined when using MinGW. Since the comments suggest MSVC-
specific code, scope to MSVC only.
2022-09-16 10:47:56 +02:00
6edb9d01dd Avoid relying on max() from windows.h
Unfortunately, windows.h breaks the standard library because it
defines max() as a macro by default.

To fix this, add NOMINMAX (and WIN32_LEAN_AND_MEAN for good measure) to
the compile options. Ideally, this would be set on a per-target basis,
but with so many OBJECT targets, that is really tedious. Luckily,
add_compile_definitions() is scoped to the current directory and sub-
directories only.
2022-09-16 10:47:56 +02:00
91a0b0be23 CMake: disable --no-undefined on Windows
link.exe emits warning LNK4044 about an unrecognized option '/-no-undefined'.

c.f. https://github.com/mesonbuild/meson/pull/4230
2022-09-16 10:47:56 +02:00