Build fixes, expose fewer internals in headers by forward-declaring more types.

This commit is contained in:
Kai Blaschke
2022-12-05 11:46:43 +01:00
parent 6485ec40fb
commit 1429b57f87
12 changed files with 98 additions and 47 deletions

View File

@ -229,7 +229,7 @@ MilkdropPresetFactory::LoadPresetFromFile(const std::string& filename)
{
return IdlePresets::allocate(this, presetOutputs);
}
else if (protocol == "" or protocol == "file")
else if (protocol == "" || protocol == "file")
{
return std::make_unique<MilkdropPreset>(this, path, presetOutputs);
}

View File

@ -4,7 +4,7 @@
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU
* License as published by the Free Software Foundation; either
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
@ -18,35 +18,33 @@
* See 'LICENSE.txt' included within this release
*
*/
/* parser.c */
#include <stdio.h>
#include <string>
#include "Parser.hpp"
#include "BuiltinFuncs.hpp"
#include "CustomShape.hpp"
#include "CustomWave.hpp"
#include "Eval.hpp"
#include "Expr.hpp"
#include "Func.hpp"
#include "InitCond.hpp"
#include "MilkdropPresetFactory.hpp"
#include "Param.hpp"
#include "ParamUtils.hpp"
#include "PerFrameEqn.hpp"
#include "PerPixelEqn.hpp"
#include "fatal.h"
#include "wipemalloc.h"
#include <array>
#include <cstring>
#include <iostream>
#include <locale>
#include <stdlib.h>
#include "fatal.h"
#include "CustomWave.hpp"
#include "CustomShape.hpp"
#include "Expr.hpp"
#include "Eval.hpp"
#include "Func.hpp"
#include "InitCond.hpp"
#include "Param.hpp"
#include "Parser.hpp"
#include "PerFrameEqn.hpp"
#include "PerPixelEqn.hpp"
#include <map>
#include "ParamUtils.hpp"
#include "wipemalloc.h"
#include <iostream>
#include <sstream>
#include "BuiltinFuncs.hpp"
#include "MilkdropPresetFactory.hpp"
#include <stdio.h>
#include <stdlib.h>
#include <string>
/* Grabs the next token from the file. The second argument points
to the raw string */

View File

@ -1,8 +1,10 @@
#pragma once
#include <Renderer/BeatDetect.hpp>
#include <Renderer/Pipeline.hpp>
#include <Renderer/PipelineContext.hpp>
#include <string>
class BeatDetect;
class Pipeline;
class PipelineContext;
class Preset
{

View File

@ -1,5 +1,9 @@
#include "PresetFactory.hpp"
#ifdef DEBUG
#include <iostream>
#endif
const std::string PresetFactory::IDLE_PRESET_PROTOCOL("idle");
std::string PresetFactory::Protocol(const std::string& url, std::string& path)

View File

@ -11,8 +11,12 @@
//
#include "PresetFactoryManager.hpp"
#include "Common.hpp"
#include <MilkdropPresetFactory/MilkdropPresetFactory.hpp>
#include <cassert>
#include <iostream>
#include <sstream>
PresetFactoryManager::~PresetFactoryManager()

View File

@ -1,9 +1,11 @@
#pragma once
#include <utility>
#include "PresetFactory.hpp"
#include <map>
#include <utility>
#include <vector>
/// A simple exception class to strongly type all preset factory related issues
class PresetFactoryException : public std::exception
{

View File

@ -45,7 +45,7 @@
#include "BackgroundWorker.h"
#include <Renderer/PipelineContext.hpp>
#include "Renderer/PipelineContext.hpp"
#include <mutex>
#include <thread>

View File

@ -23,12 +23,6 @@ set_target_properties(projectM_shared PROPERTIES
target_include_directories(projectM_shared
PUBLIC
"$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/include>"
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>"
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/Renderer>"
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/Renderer/hlslparser/src>"
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/MilkdropPresetFactory>"
"$<BUILD_INTERFACE:${MSVC_EXTRA_INCLUDE_DIR}>"
"$<INSTALL_INTERFACE:${PROJECTM_INCLUDE_DIR}>"
)

View File

@ -21,12 +21,6 @@ set_target_properties(projectM_static PROPERTIES
target_include_directories(projectM_static
PUBLIC
"$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/include>"
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>"
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/Renderer>"
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/Renderer/hlslparser/src>"
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/MilkdropPresetFactory>"
"$<BUILD_INTERFACE:${MSVC_EXTRA_INCLUDE_DIR}>"
"$<INSTALL_INTERFACE:${PROJECTM_INCLUDE_DIR}>"
)

View File

@ -75,7 +75,6 @@ int projectMSDL::toggleAudioInput() {
CurAudioDevice = -1; // Return to the default audio device.
#ifdef WASAPI_LOOPBACK
// If we are at the boundary and WASAPI is enabled then let's load WASAPI instead.
projectm_set_toast_message(_projectM, "Loopback audio selected");
SDL_Log("Loopback audio selected");
this->fakeAudio = false; // disable fakeAudio in case it was enabled.
this->wasapi = true; // Track wasapi as on so projectMSDL will listen to it.

50
src/sdl-test-ui/opengl.h Normal file
View File

@ -0,0 +1,50 @@
/**
Include appropriate OpenGL headers for this platform.
**/
#ifndef __PROJECTM_OPENGL_H__
#define __PROJECTM_OPENGL_H__
// stuff that needs to be ported to newer GL calls
#define GL_TRANSITION
// Enable openGL extra checks, better not be enabled in release build
#define OGL_DEBUG 0
// Unlock FPS for rendering benchmarks, it disables Vblank/Vsync and prints drawn frame count within a 5s test run
#define UNLOCK_FPS 0
// If a shader compilation failure occurs, it dumps shader source into /tmp instead of stderr
#define DUMP_SHADERS_ON_ERROR 0
#ifdef __APPLE__
# include <OpenGL/gl3.h>
# include <OpenGL/gl3ext.h>
#elif defined(EYETUNE_WINRT)
#define GL_GLEXT_PROTOTYPES
#define GLM_FORCE_CXX03
#include <GLES3/gl31.h>
#include <GLES3/gl3.h>
#include <GLES2/gl2.h>
#include <GLES2/gl2ext.h>
#include <EGL/egl.h>
#include <EGL/eglext.h>
#elif defined(_WIN32)
#define GLM_FORCE_CXX03
# include <windows.h>
#include "GL/glew.h"
#include "GL/wglew.h"
#else /* linux/unix/other */
# if USE_GLES
# include <GLES3/gl3.h>
# else
# if !defined(GL_GLEXT_PROTOTYPES)
# define GL_GLEXT_PROTOTYPES
# endif
# include <GL/gl.h>
# include <GL/glext.h>
# endif
#endif
#endif // __PROJECTM_OPENGL_H__

View File

@ -43,12 +43,12 @@
#include <libprojectM/projectM.h>
#include <libprojectM/sdltoprojectM.h>
#include <playlist.h>
#include <projectM-opengl.h>
// projectM SDL
#include "setup.hpp"
#include "loopback.hpp"
#include "audioCapture.hpp"
#include "loopback.hpp"
#include "opengl.h"
#include "setup.hpp"
#if defined _MSC_VER
@ -89,7 +89,11 @@
#ifndef DATADIR_PATH
#ifdef DEBUG
#define DATADIR_PATH "."
#ifndef _WIN32
#warning "DATADIR_PATH is not defined - falling back to ./"
#else
#pragma warning "DATADIR_PATH is not defined - falling back to ./"
#endif /** _WIN32 */
#else
#define DATADIR_PATH "/usr/local/share/projectM"
#ifndef _WIN32