Deleted the now unused Renderer class.

This commit is contained in:
Kai Blaschke
2023-10-24 16:39:37 +02:00
parent 6645b9da00
commit 7b8af19fc4
5 changed files with 0 additions and 156 deletions

View File

@ -23,7 +23,6 @@
#include "Preset.hpp"
#include "PresetFactoryManager.hpp"
#include "Renderer.hpp"
#include "TextureManager.hpp"
#include "TimeKeeper.hpp"
#include "libprojectM/Audio/BeatDetect.hpp"
@ -215,8 +214,6 @@ void ProjectM::Initialize()
m_beatDetect = std::make_unique<libprojectM::Audio::BeatDetect>(m_pcm);
m_renderer = std::make_unique<Renderer>(m_windowWidth, m_windowHeight);
m_textureManager = std::make_unique<TextureManager>(m_textureSearchPaths);
m_presetFactoryManager->initialize();
@ -258,15 +255,6 @@ void ProjectM::ResetOpenGL(size_t width, size_t height)
/** Stash the new dimensions */
m_windowWidth = width;
m_windowHeight = height;
try
{
m_renderer->reset(width, height);
}
catch (const RenderException& ex)
{
// ToDo: Add generic error callback
}
}
void ProjectM::StartPresetTransition(std::unique_ptr<Preset>&& preset, bool hardCut)
@ -452,34 +440,18 @@ auto ProjectM::PCM() -> libprojectM::Audio::PCM&
void ProjectM::Touch(float touchX, float touchY, int pressure, int touchType)
{
if (m_renderer)
{
m_renderer->touch(touchX, touchY, pressure, touchType);
}
}
void ProjectM::TouchDrag(float touchX, float touchY, int pressure)
{
if (m_renderer)
{
m_renderer->touchDrag(touchX, touchY, pressure);
}
}
void ProjectM::TouchDestroy(float touchX, float touchY)
{
if (m_renderer)
{
m_renderer->touchDestroy(touchX, touchY);
}
}
void ProjectM::TouchDestroyAll()
{
if (m_renderer)
{
m_renderer->touchDestroyAll();
}
}
auto ProjectM::GetRenderContext() -> RenderContext

View File

@ -246,7 +246,6 @@ private:
std::unique_ptr<PresetFactoryManager> m_presetFactoryManager; //!< Provides access to all available preset factories.
std::unique_ptr<Renderer> m_renderer; //!< The Preset renderer.
std::unique_ptr<TextureManager> m_textureManager; //!< The texture manager.
std::unique_ptr<libprojectM::Audio::BeatDetect> m_beatDetect; //!< The beat detection class.
std::unique_ptr<Preset> m_activePreset; //!< Currently loaded preset.

View File

@ -7,8 +7,6 @@ add_library(Renderer OBJECT
RenderContext.hpp
RenderItem.cpp
RenderItem.hpp
Renderer.cpp
Renderer.hpp
Sampler.cpp
Sampler.hpp
Shader.cpp

View File

@ -1,45 +0,0 @@
#include "Renderer.hpp"
using namespace std::chrono;
class Preset;
Renderer::Renderer(int viewportWidth, int viewportHeight)
{
reset(viewportWidth, viewportHeight);
}
Renderer::~Renderer()
{
}
void Renderer::reset(int viewportWidth, int viewportHeight)
{
m_mainTextureSizeX = viewportWidth;
m_mainTextureSizeY = viewportHeight;
// snap to 16x16 blocks
m_mainTextureSizeX = ((m_mainTextureSizeX - 15) / 16) * 16;
m_mainTextureSizeY = ((m_mainTextureSizeY - 15) / 16) * 16;
}
// Render a waveform when a touch event is triggered.
void Renderer::touch(float x, float y, int pressure, int type = 0)
{
}
// Move a waveform when dragging X, Y, and Pressure can change. We also extend the counters so it will stay on screen for as long as you click and drag.
void Renderer::touchDrag(float x, float y, int pressure)
{
}
// Remove waveform at X Y
void Renderer::touchDestroy(float x, float y)
{
}
// Remove all waveforms
void Renderer::touchDestroyAll()
{
}

View File

@ -1,80 +0,0 @@
#pragma once
#include "Audio/BeatDetect.hpp"
#include "projectM-opengl.h"
#include <chrono>
#include <ctime>
#include <iostream>
#include <list>
#include <memory>
#include <set>
#include <string>
using namespace std::chrono;
// for final composite grid:
#define FCGSX 32 // final composite gridsize - # verts - should be EVEN.
#define FCGSY 24 // final composite gridsize - # verts - should be EVEN.
// # of grid *cells* is two less,
// since we have redundant verts along the center line in X and Y (...for clean 'ang' interp)
typedef struct
{
float x, y; // screen position + Z-buffer depth
float Diffuse[4]; // diffuse color
float tu, tv; // DYNAMIC
float rad, ang; // STATIC
} composite_shader_vertex;
namespace libprojectM {
namespace Audio {
class BeatDetect;
}
} // namespace libprojectM
class Texture;
class TextureManager;
class TimeKeeper;
class RenderException : public std::exception
{
public:
inline RenderException(std::string message)
: m_message(std::move(message))
{
}
virtual ~RenderException() = default;
const std::string& message() const
{
return m_message;
}
private:
std::string m_message;
};
class Renderer
{
public:
Renderer() = delete;
Renderer(int viewportWidth, int viewportHeight);
~Renderer();
void reset(int viewportWidth, int viewportHeight);
void touch(float x, float y, int pressure, int type);
void touchDrag(float x, float y, int pressure);
void touchDestroy(float x, float y);
void touchDestroyAll();
private:
int m_mainTextureSizeX{0};
int m_mainTextureSizeY{0};
};