Commit Graph

1993 Commits

Author SHA1 Message Date
37f2cb2b00 Renderer: Fix build with GCC 12
In file included from /projectm/src/libprojectM/Renderer/Renderer.cpp:1:
/projectm/src/libprojectM/Renderer/Renderer.hpp:191:10: error: ‘unique_ptr’ in namespace ‘std’ does not name a template type
  191 |     std::unique_ptr<TextureManager> m_textureManager;
      |          ^~~~~~~~~~
2022-09-15 17:03:48 +02:00
371365a03f ProjectM.cpp: Unname unused parameters
Amends the previous commit.

In order to avoid unused parameter warnings when building the library
itself, also unname these parameters here.

The names of these parameters are still named in ProjectM.hpp, so they
serve as documentation. In ProjectM.cpp, they are mere stubs.

As a drive-by, removed some unneeded newlines.
2022-09-15 16:57:40 +02:00
c547489feb ProjectM.{hpp,cpp}: Move event function stubs
This will avoid -Wunused-parameter warnings in client applications.
2022-09-15 16:57:40 +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
0d047407dc ProjectM.hpp: Use #pragma warning on MSVC only
Fixes multiple "warning: unknown pragma ignored [-Wunknown-pragmas]"
diagnostics on GCC/Clang when used with MinGW, both when building the
library aswell as in client applications.
2022-09-15 16:57:40 +02:00
0d2355ca8f Fix macOS compilation due to unsupported query param.
Querying will certainly fail, but the value is then guaranteed to be unchanged. We'll be using GL_BGRA in this case, which works perfectly fine.
2022-09-09 00:59:25 +02:00
c1a0317367 Fixed a crash when calling ReadConfig() early. 2022-09-09 00:59:25 +02:00
e35ef8b83a Got the texture format wrong on a previous commit. Fixed to use the proper format.
Also query the optimal internal format on desktop GL implementations and use a sensible default for GLES as it doesn't support the query target.
2022-09-09 00:59:25 +02:00
1a1eb871d8 Fix CMake's find_package(libprojectM) with Emscripten and GLES builds 2022-09-09 00:57:03 +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
4edfd687f5 Copy texturePath to settings member in ReadSettings()
Why isn't this done via a simple assignment?
2022-09-09 00:45:59 +02:00
d655ae411c Don't crash if dir list is empty on UNIX systems, avoid string copying on Windows. 2022-09-09 00:45:59 +02:00
60dd295ee6 Expose texture path in the public API, removed unused font settings. 2022-09-09 00:45:58 +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
0e026ac7af Cleaned up TextureManager header, renamed members and fixed search path list usage. 2022-09-09 00:45:57 +02:00
3dab0dafc8 Quick fix: Cut off any text after end of shader's main() function
In a shader, the main function must be the last one declared. Everything following it isn't used and the HLSL compiler seems to simply ignore it. Some preset authors put credits after the closing bracket without //, which fails shader compilation in projectM. We'll now just cut off any text following the last closing bracket. One example preset is "martin - city lights.milk".
2022-07-25 12:05:46 +02:00
595a9a6cbf Disable line smoothing which is not supported in GLES, use different GL constants for other calls.
Using "GL_CLAMP_TO_EDGE" could in theory make textured shaped look weird, but the image should ideally be filling the shape completely, so users will in practice never see the actual texture border.
2022-07-11 14:26:57 +02:00
a6293f63c8 Fix function name casing causing an error with threads disabled. 2022-07-11 14:26:57 +02:00
460a2dcd84 suggested change for float cast 2022-06-27 19:09:34 +02:00
e73917d32a did not mean to change float cast style 2022-06-27 19:09:34 +02:00
4ef7f44b8d projectm_pcm_add_float_1ch_data to projectm_pcm_add_float 2022-06-27 19:09:34 +02:00
9298ae396c Remove unused RenderItem* files 2022-06-09 10:48:57 +02:00
39ceea422b Fix playlist loading check. 2022-06-06 18:50:50 +02:00
65a2496bfa Removed parameters from ProjectM initializer functions and set aspect correction earlier.
All parameters were just values from the internal settings struct, which is readily available - no need to pass them on the stack.
2022-06-06 18:50:50 +02:00
b28d3762ab Simplified ProjectM::RenderFrameOnlyPass2 2022-06-06 18:50:50 +02:00
828a0eb04a Moved comments for ProjectM::RenderFrameOnlyPass1 to header. 2022-06-06 18:50:50 +02:00
3dbf4ecb4b Instantiate PipelineContext directly.
The class has no real dependencies and sind we no longer need to hide internal dependencies we can just use it directly.
2022-06-06 18:50:50 +02:00
9dca6e7857 More cleanups in RenderFrame* methods. 2022-06-06 18:50:50 +02:00
f2e0b09bde Added a FIXME for later improvements of async preset loading. 2022-06-06 18:50:50 +02:00
7334c8085b A few cleanups in the RenderFrame functions. 2022-06-06 18:50:50 +02:00
1e25e2119c Removed unused "interface" enum. 2022-06-06 18:50:50 +02:00
03f202859b Moved inline implementations to ProjectM.cpp. 2022-06-06 18:50:50 +02:00
1af2b97e50 Remove ProjectM::DestroyPresetTools
Unique pointers are destroyed automatically during destruction of the class and the method isn't called from anywhere else.
2022-06-06 18:50:50 +02:00
0a271b8086 Remove unnecessary/dead code from ProjectM::InitializePresetTools.
Function is only called from constructors, so failing to initialize important subsystems would leave projectM unusable, and we can simply let the exception bubble up to the caller. Such exceptions are already being caught in the C wrapper.
2022-06-06 18:50:50 +02:00
576654d676 Build fix: rename a few missed instances of _settings to m_settings 2022-06-06 18:50:50 +02:00
2c2a830843 Reformatted ProjectM class code 2022-06-06 18:50:50 +02:00
db6959c3ab Cleaned up member function parameters. 2022-06-06 18:50:50 +02:00
60f93d7de1 Use trailing return types. 2022-06-06 18:50:50 +02:00
b7e3943cc2 Move methods only used internally into private section. 2022-06-06 18:50:50 +02:00
73c6d2793c Fixed member casing in ProjectM class. 2022-06-06 18:50:50 +02:00
5e5b35fdb8 Replaced behaviour FLAG_* constants with an enum. 2022-06-06 18:50:50 +02:00
27b1a57b82 Removed unimplemented members. 2022-06-06 18:50:50 +02:00
3cc3667347 Moved class members to bottom, replaced some types and added default initializers.
Mostly replaced raw pointers with std::unique_ptr for easier memory management. Probably not needed for many of those classes, but was the least intrusive change for now.
2022-06-06 18:50:50 +02:00
7488250cab Removed framerate limiting code from ProjectM class.
The library should not hold up any external render loop. Waiting for vsync or achieving a target FPS value should be done by the outside application after presenting the render result.
2022-06-06 18:50:50 +02:00
c9b8d5e76a Renamed ProjectM class members to have m_ prefix. 2022-06-06 18:50:50 +02:00
1385adb368 Cleaned up includes in ProjectM class. 2022-06-06 18:50:50 +02:00
f2b04480c0 Renamed projectM class to ProjectM 2022-06-06 18:50:50 +02:00