Skip to content

Commit 14988b2

Browse files
HeliumAntjanisozaur
authored andcommitted
use glm fwd declare in postprocessman
1 parent b1860ee commit 14988b2

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

Source/Managers/PostProcessMan.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ void PostProcessMan::CreateGLBackBuffers() {
126126
glTexParameteri(GL_TEXTURE_1D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
127127
UpdatePalette();
128128
glActiveTexture(GL_TEXTURE0);
129-
m_ProjectionMatrix = glm::ortho(0.0F, static_cast<float>(g_FrameMan.GetBackBuffer8()->w), 0.0F, static_cast<float>(g_FrameMan.GetBackBuffer8()->h), -1.0F, 1.0F);
129+
m_ProjectionMatrix = std::make_unique<glm::mat4>(glm::ortho(0.0F, static_cast<float>(g_FrameMan.GetBackBuffer8()->w), 0.0F, static_cast<float>(g_FrameMan.GetBackBuffer8()->h), -1.0F, 1.0F));
130130
}
131131

132132
void PostProcessMan::UpdatePalette() {
@@ -457,7 +457,7 @@ void PostProcessMan::DrawDotGlowEffects() {
457457
transformMatrix = glm::translate(transformMatrix, glm::vec3(x + 0.5f, y + 0.5f, 0));
458458
transformMatrix = glm::scale(transformMatrix, glm::vec3(m_YellowGlow->w * 0.5f, m_YellowGlow->h * 0.5f, 1.0));
459459
m_PostProcessShader->SetInt(m_PostProcessShader->GetTextureUniform(), 0);
460-
m_PostProcessShader->SetMatrix4f(m_PostProcessShader->GetProjectionUniform(), m_ProjectionMatrix);
460+
m_PostProcessShader->SetMatrix4f(m_PostProcessShader->GetProjectionUniform(), *m_ProjectionMatrix);
461461
m_PostProcessShader->SetMatrix4f(m_PostProcessShader->GetTransformUniform(), transformMatrix);
462462
GL_CHECK(glDrawArrays(GL_TRIANGLE_STRIP, 0, 4));
463463
}
@@ -487,7 +487,7 @@ void PostProcessMan::DrawPostScreenEffects() {
487487
glBindVertexArray(m_VertexArray);
488488
m_PostProcessShader->Use();
489489
m_PostProcessShader->SetInt(m_PostProcessShader->GetTextureUniform(), 0);
490-
m_PostProcessShader->SetMatrix4f(m_PostProcessShader->GetProjectionUniform(), m_ProjectionMatrix);
490+
m_PostProcessShader->SetMatrix4f(m_PostProcessShader->GetProjectionUniform(), *m_ProjectionMatrix);
491491

492492
for (const PostEffect& postEffect: m_PostScreenEffects) {
493493
if (postEffect.m_Bitmap) {

Source/Managers/PostProcessMan.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,14 @@
22

33
#include "Singleton.h"
44
#include "Box.h"
5-
#include "SceneMan.h"
65
#include "glad/gl.h"
7-
#include <glm/glm.hpp>
6+
#include "glm/fwd.hpp"
7+
#include "SceneMan.h"
88
#include "Shader.h"
99

1010
#include <array>
1111
#include <atomic>
12+
#include <memory>
1213
#include <list>
1314
#include <vector>
1415

@@ -184,7 +185,7 @@ namespace RTE {
184185
GLuint m_BlitFramebuffer; //!< Framebuffer for blitting the 8bpp backbuffer to the 32bpp backbuffer.
185186
GLuint m_PostProcessFramebuffer; //!< Framebuffer for post-processing effects.
186187
GLuint m_PostProcessDepthBuffer; //!< Depth buffer for post-processing effects.
187-
glm::mat4 m_ProjectionMatrix; //!< Projection matrix for post-processing effects.
188+
std::unique_ptr<glm::mat4> m_ProjectionMatrix; //!< Projection matrix for post-processing effects.
188189
GLuint m_VertexBuffer; //!< Vertex buffer for post-processing effects.
189190
GLuint m_VertexArray; //!< Vertex array for post-processing effects.
190191
std::unique_ptr<Shader> m_Blit8; //!< Shader for blitting the 8bpp backbuffer to the 32bpp backbuffer.

0 commit comments

Comments
 (0)