Moves and cleanups includes and public/private section of PostprocManager.
Reviewed By: elexis This was SVN commit r22738.
This commit is contained in:
parent
3285f43394
commit
486691b49a
@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 2015 Wildfire Games.
|
||||
/* Copyright (C) 2019 Wildfire Games.
|
||||
* This file is part of 0 A.D.
|
||||
*
|
||||
* 0 A.D. is free software: you can redistribute it and/or modify
|
||||
@ -17,21 +17,19 @@
|
||||
|
||||
#include "precompiled.h"
|
||||
|
||||
#include "lib/ogl.h"
|
||||
#include "maths/MathUtil.h"
|
||||
|
||||
#include "gui/GUIutil.h"
|
||||
#include "lib/bits.h"
|
||||
#include "ps/CLogger.h"
|
||||
#include "ps/Filesystem.h"
|
||||
#include "ps/Game.h"
|
||||
#include "ps/World.h"
|
||||
#include "renderer/PostprocManager.h"
|
||||
|
||||
#include "graphics/GameView.h"
|
||||
#include "graphics/LightEnv.h"
|
||||
#include "graphics/ShaderManager.h"
|
||||
|
||||
#include "renderer/PostprocManager.h"
|
||||
#include "gui/GUIutil.h"
|
||||
#include "lib/bits.h"
|
||||
#include "lib/ogl.h"
|
||||
#include "maths/MathUtil.h"
|
||||
#include "ps/CLogger.h"
|
||||
#include "ps/Filesystem.h"
|
||||
#include "ps/Game.h"
|
||||
#include "ps/World.h"
|
||||
#include "renderer/Renderer.h"
|
||||
|
||||
#if !CONFIG2_GLES
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 2015 Wildfire Games.
|
||||
/* Copyright (C) 2019 Wildfire Games.
|
||||
* This file is part of 0 A.D.
|
||||
*
|
||||
* 0 A.D. is free software: you can redistribute it and/or modify
|
||||
@ -18,11 +18,51 @@
|
||||
#ifndef INCLUDED_POSTPROCMANAGER
|
||||
#define INCLUDED_POSTPROCMANAGER
|
||||
|
||||
|
||||
#include "graphics/ShaderTechnique.h"
|
||||
#include "ps/CStr.h"
|
||||
|
||||
#include <vector>
|
||||
|
||||
class CPostprocManager
|
||||
{
|
||||
public:
|
||||
CPostprocManager();
|
||||
~CPostprocManager();
|
||||
|
||||
// Create all buffers/textures in GPU memory and set default effect.
|
||||
// @note Must be called before using in the renderer. May be called multiple times.
|
||||
void Initialize();
|
||||
|
||||
// Update the size of the screen
|
||||
void Resize();
|
||||
|
||||
// Returns a list of xml files found in shaders/effects/postproc.
|
||||
static std::vector<CStrW> GetPostEffects();
|
||||
|
||||
// Returns the name of the current effect.
|
||||
const CStrW& GetPostEffect() const
|
||||
{
|
||||
return m_PostProcEffect;
|
||||
}
|
||||
|
||||
// Sets the current effect.
|
||||
void SetPostEffect(const CStrW& name);
|
||||
|
||||
// Clears the two color buffers and depth buffer, and redirects all rendering
|
||||
// to our textures instead of directly to the system framebuffer.
|
||||
// @note CPostprocManager must be initialized first
|
||||
void CaptureRenderOutput();
|
||||
|
||||
// First renders blur textures, then calls ApplyEffect for each effect pass,
|
||||
// ping-ponging the buffers at each step.
|
||||
// @note CPostprocManager must be initialized first
|
||||
void ApplyPostproc();
|
||||
|
||||
// Blits the final postprocessed texture to the system framebuffer. The system framebuffer
|
||||
// is selected as the output buffer. Should be called before silhouette rendering.
|
||||
// @note CPostprocManager must be initialized first
|
||||
void ReleaseRenderOutput();
|
||||
|
||||
private:
|
||||
|
||||
// Two framebuffers, that we flip between at each shader pass.
|
||||
@ -75,45 +115,6 @@ private:
|
||||
// Delete existing buffers/textures and create them again, using a new screen size if needed.
|
||||
// (the textures are also attached to the framebuffers)
|
||||
void RecreateBuffers();
|
||||
|
||||
public:
|
||||
CPostprocManager();
|
||||
~CPostprocManager();
|
||||
|
||||
// Create all buffers/textures in GPU memory and set default effect.
|
||||
// @note Must be called before using in the renderer. May be called multiple times.
|
||||
void Initialize();
|
||||
|
||||
// Update the size of the screen
|
||||
void Resize();
|
||||
|
||||
// Returns a list of xml files found in shaders/effects/postproc.
|
||||
static std::vector<CStrW> GetPostEffects();
|
||||
|
||||
// Returns the name of the current effect.
|
||||
inline const CStrW& GetPostEffect() const
|
||||
{
|
||||
return m_PostProcEffect;
|
||||
}
|
||||
|
||||
// Sets the current effect.
|
||||
void SetPostEffect(const CStrW& name);
|
||||
|
||||
// Clears the two color buffers and depth buffer, and redirects all rendering
|
||||
// to our textures instead of directly to the system framebuffer.
|
||||
// @note CPostprocManager must be initialized first
|
||||
void CaptureRenderOutput();
|
||||
|
||||
// First renders blur textures, then calls ApplyEffect for each effect pass,
|
||||
// ping-ponging the buffers at each step.
|
||||
// @note CPostprocManager must be initialized first
|
||||
void ApplyPostproc();
|
||||
|
||||
// Blits the final postprocessed texture to the system framebuffer. The system framebuffer
|
||||
// is selected as the output buffer. Should be called before silhouette rendering.
|
||||
// @note CPostprocManager must be initialized first
|
||||
void ReleaseRenderOutput();
|
||||
};
|
||||
|
||||
|
||||
#endif //INCLUDED_POSTPROCMANAGER
|
||||
#endif // INCLUDED_POSTPROCMANAGER
|
||||
|
Loading…
Reference in New Issue
Block a user