mirror of
https://github.com/projectM-visualizer/projectm.git
synced 2026-04-29 09:56:20 +00:00
Replace temp framebuffer blit with a final draw call in ProjectM class
This avoids two fullscreen draw calls during transitions, and should also be slightly faster than using glBlitFramebuffer(). As with all drawing operations, we currently don't really care about the target framebuffer size or aspect ratio and just draw a quad over the whole viewport.
This commit is contained in:
@ -28,6 +28,7 @@
|
||||
#include "Audio/BeatDetect.hpp"
|
||||
#include "Audio/PCM.hpp" //Sound data handler (buffering, FFT, etc.)
|
||||
|
||||
#include "Renderer/CopyTexture.hpp"
|
||||
#include "Renderer/PresetTransition.hpp"
|
||||
#include "Renderer/TextureManager.hpp"
|
||||
#include "Renderer/TransitionShaderManager.hpp"
|
||||
@ -217,11 +218,17 @@ void ProjectM::RenderFrame()
|
||||
// ToDo: Call the to-be-implemented render method in Renderer
|
||||
m_activePreset->RenderFrame(audioData, renderContext);
|
||||
|
||||
// ToDo: Allow external apps to provide a custom target framebuffer.
|
||||
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);
|
||||
|
||||
if (m_transition != nullptr && m_transitioningPreset != nullptr)
|
||||
{
|
||||
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);
|
||||
m_transition->Draw(*m_activePreset, *m_transitioningPreset, renderContext, audioData);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_textureCopier->Draw(m_activePreset->OutputTexture(), false, false);
|
||||
}
|
||||
|
||||
m_frameCount++;
|
||||
}
|
||||
@ -246,6 +253,8 @@ void ProjectM::Initialize()
|
||||
|
||||
m_transitionShaderManager = std::make_unique<TransitionShaderManager>();
|
||||
|
||||
m_textureCopier = std::make_unique<CopyTexture>();
|
||||
|
||||
m_presetFactoryManager->initialize();
|
||||
|
||||
/* Set the seed to the current time in seconds */
|
||||
|
||||
Reference in New Issue
Block a user