From: Mikko Rasa Date: Fri, 1 Oct 2021 18:03:34 +0000 (+0300) Subject: Some more cleanup of includes and forward declarations X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=5bb193f930fb8738d099d630c4d625d82c1215b5;p=libs%2Fgl.git Some more cleanup of includes and forward declarations --- diff --git a/source/builders/font.h b/source/builders/font.h index 18c225c1..2bb61f75 100644 --- a/source/builders/font.h +++ b/source/builders/font.h @@ -5,7 +5,6 @@ #include #include #include -#include "vertexarray.h" namespace Msp { namespace GL { diff --git a/source/builders/sequencetemplate.cpp b/source/builders/sequencetemplate.cpp index 6e50c248..67fb4d91 100644 --- a/source/builders/sequencetemplate.cpp +++ b/source/builders/sequencetemplate.cpp @@ -1,5 +1,6 @@ #include #include +#include #include "ambientocclusion.h" #include "blend.h" #include "bloom.h" diff --git a/source/builders/sequencetemplate.h b/source/builders/sequencetemplate.h index 81a130ef..c49b2d43 100644 --- a/source/builders/sequencetemplate.h +++ b/source/builders/sequencetemplate.h @@ -8,7 +8,7 @@ #include "blend.h" #include "depthtest.h" #include "postprocessor.h" -#include "predicate.h" +#include "resources.h" #include "stenciltest.h" namespace Msp { diff --git a/source/effects/ambientocclusion.cpp b/source/effects/ambientocclusion.cpp index d8470077..d431bcdd 100644 --- a/source/effects/ambientocclusion.cpp +++ b/source/effects/ambientocclusion.cpp @@ -2,8 +2,10 @@ #include "ambientocclusion.h" #include "blend.h" #include "camera.h" +#include "mesh.h" #include "renderer.h" #include "resources.h" +#include "texture2d.h" using namespace std; diff --git a/source/effects/ambientocclusion.h b/source/effects/ambientocclusion.h index 0171d89e..fd3b6574 100644 --- a/source/effects/ambientocclusion.h +++ b/source/effects/ambientocclusion.h @@ -1,17 +1,15 @@ #ifndef MSP_GL_AMBIENTOCCLUSION_H_ #define MSP_GL_AMBIENTOCCLUSION_H_ -#include "framebuffer.h" -#include "mesh.h" #include "postprocessor.h" -#include "program.h" #include "programdata.h" #include "rendertarget.h" -#include "texture2d.h" namespace Msp { namespace GL { +class Program; + /** Implements screen-space ambient occlusion. diff --git a/source/effects/bloom.cpp b/source/effects/bloom.cpp index aac226d9..a6fefa6e 100644 --- a/source/effects/bloom.cpp +++ b/source/effects/bloom.cpp @@ -1,9 +1,10 @@ #include #include -#include "blend.h" #include "bloom.h" +#include "mesh.h" #include "renderer.h" #include "resources.h" +#include "texture2d.h" using namespace std; diff --git a/source/effects/bloom.h b/source/effects/bloom.h index b80388d6..d6c9307c 100644 --- a/source/effects/bloom.h +++ b/source/effects/bloom.h @@ -1,17 +1,15 @@ #ifndef MSP_GL_BLOOM_H_ #define MSP_GL_BLOOM_H_ -#include "framebuffer.h" -#include "mesh.h" #include "postprocessor.h" -#include "texture2d.h" -#include "program.h" #include "programdata.h" #include "rendertarget.h" namespace Msp { namespace GL { +class Program; + /** The Bloom post-processing effect causes very bright areas of the image to bleed into surrounding pixels. Commonly used together with HDR rendering. diff --git a/source/effects/colorcurve.h b/source/effects/colorcurve.h index 3ccfbf76..01a7d35d 100644 --- a/source/effects/colorcurve.h +++ b/source/effects/colorcurve.h @@ -2,13 +2,14 @@ #define MSP_GL_COLORCURVE_H_ #include "postprocessor.h" -#include "program.h" #include "programdata.h" #include "texture1d.h" namespace Msp { namespace GL { +class Program; + /** Processes oversaturated colors to preserve hues. When one color component exceeds 1.0, the overflow is distributed to the other components, scaling the diff --git a/source/effects/effect.cpp b/source/effects/effect.cpp index e335b46a..584117e7 100644 --- a/source/effects/effect.cpp +++ b/source/effects/effect.cpp @@ -1,5 +1,4 @@ #include "effect.h" -#include "sampler.h" namespace Msp { namespace GL { diff --git a/source/effects/effect.h b/source/effects/effect.h index a4f108fb..d763f251 100644 --- a/source/effects/effect.h +++ b/source/effects/effect.h @@ -2,14 +2,11 @@ #define MSP_GL_EFFECT_H_ #include -#include #include "renderable.h" namespace Msp { namespace GL { -class Sampler; - /** Effects are used to wrap other renderables and give them additional visual properties. An Effect's render method should set up the necessary state, call diff --git a/source/effects/environmentmap.h b/source/effects/environmentmap.h index 9c8447f6..98328488 100644 --- a/source/effects/environmentmap.h +++ b/source/effects/environmentmap.h @@ -1,19 +1,19 @@ #ifndef MSP_GL_ENVIRONMENTMAP_H_ #define MSP_GL_ENVIRONMENTMAP_H_ +#include #include "camera.h" #include "effect.h" #include "framebuffer.h" -#include "matrix.h" #include "programdata.h" #include "texture2d.h" #include "texturecube.h" -#include "vector.h" namespace Msp { namespace GL { class Mesh; +class Sampler; /** Creates a cube map texture of the surroundings of the renderable. This texture diff --git a/source/effects/shadowmap.cpp b/source/effects/shadowmap.cpp index bf075778..972fefc2 100644 --- a/source/effects/shadowmap.cpp +++ b/source/effects/shadowmap.cpp @@ -1,10 +1,6 @@ -#include -#include -#include "camera.h" #include "light.h" #include "renderer.h" #include "resources.h" -#include "scene.h" #include "shadowmap.h" using namespace std; diff --git a/source/effects/shadowmap.h b/source/effects/shadowmap.h index 81563a72..63d946c2 100644 --- a/source/effects/shadowmap.h +++ b/source/effects/shadowmap.h @@ -13,7 +13,6 @@ namespace Msp { namespace GL { class Light; -class Resources; /** Creates shadows on a renderable through a shadow map texture. In the setup diff --git a/source/effects/sky.h b/source/effects/sky.h index 74580d75..be31b308 100644 --- a/source/effects/sky.h +++ b/source/effects/sky.h @@ -2,7 +2,6 @@ #define MSP_GL_SKY_H_ #include "effect.h" -#include "framebuffer.h" #include "programdata.h" #include "rendertarget.h" diff --git a/source/materials/light.cpp b/source/materials/light.cpp index e8cbbaac..8f546172 100644 --- a/source/materials/light.cpp +++ b/source/materials/light.cpp @@ -1,7 +1,6 @@ #include #include #include "light.h" -#include "matrix.h" #include "programdata.h" using namespace std; diff --git a/source/materials/light.h b/source/materials/light.h index 4532d0d4..a6ffd16e 100644 --- a/source/materials/light.h +++ b/source/materials/light.h @@ -1,15 +1,15 @@ #ifndef MSP_GL_LIGHT_H_ #define MSP_GL_LIGHT_H_ -#include #include +#include #include "color.h" #include "placeable.h" +#include "vector.h" namespace Msp { namespace GL { -class Matrix; class ProgramData; /** diff --git a/source/materials/lighting.cpp b/source/materials/lighting.cpp index 4c22ba3c..0fc26ab5 100644 --- a/source/materials/lighting.cpp +++ b/source/materials/lighting.cpp @@ -4,10 +4,8 @@ #include #include #include -#include "error.h" #include "light.h" #include "lighting.h" -#include "matrix.h" using namespace std; diff --git a/source/materials/technique.cpp b/source/materials/technique.cpp index e41f0c8e..21cb3a32 100644 --- a/source/materials/technique.cpp +++ b/source/materials/technique.cpp @@ -3,9 +3,7 @@ #include #include #include "material.h" -#include "program.h" #include "programdata.h" -#include "tag.h" #include "technique.h" #include "texture.h" diff --git a/source/materials/technique.h b/source/materials/technique.h index 74c37fc8..419c6765 100644 --- a/source/materials/technique.h +++ b/source/materials/technique.h @@ -1,6 +1,7 @@ #ifndef MSP_GL_TECHNIQUE_H_ #define MSP_GL_TECHNIQUE_H_ +#include #include "renderpass.h" #include "tag.h" diff --git a/source/render/instancearray.cpp b/source/render/instancearray.cpp index 37d7ccb6..d27fa819 100644 --- a/source/render/instancearray.cpp +++ b/source/render/instancearray.cpp @@ -1,7 +1,6 @@ #include #include #include "buffer.h" -#include "camera.h" #include "instancearray.h" #include "mesh.h" #include "object.h" diff --git a/source/render/instancearray.h b/source/render/instancearray.h index 4d7d3475..8f5c7322 100644 --- a/source/render/instancearray.h +++ b/source/render/instancearray.h @@ -13,8 +13,6 @@ namespace GL { class Buffer; class Object; class ObjectInstance; -class VertexArray; -class VertexSetup; /** Renders multiple instances of an Object in an efficient manner. If instanced diff --git a/source/render/object.cpp b/source/render/object.cpp index 479e77af..98eb05f7 100644 --- a/source/render/object.cpp +++ b/source/render/object.cpp @@ -2,12 +2,9 @@ #include #include #include "error.h" -#include "material.h" #include "mesh.h" #include "object.h" #include "objectinstance.h" -#include "program.h" -#include "programdata.h" #include "renderer.h" #include "resourcemanager.h" #include "technique.h" diff --git a/source/render/object.h b/source/render/object.h index ca41ffac..0fbcf383 100644 --- a/source/render/object.h +++ b/source/render/object.h @@ -9,11 +9,9 @@ namespace Msp { namespace GL { -class Material; class Mesh; class ObjectInstance; class Technique; -class Texture; /** Combines a Mesh with a Technique to give it an appearance. The Technique will diff --git a/source/render/occludedscene.cpp b/source/render/occludedscene.cpp index 975510e5..81af42b3 100644 --- a/source/render/occludedscene.cpp +++ b/source/render/occludedscene.cpp @@ -1,9 +1,10 @@ #include #include "camera.h" +#include "mesh.h" #include "occludedscene.h" +#include "program.h" #include "renderer.h" #include "resources.h" -#include "sphere.h" using namespace std; diff --git a/source/render/occludedscene.h b/source/render/occludedscene.h index f11c707e..d51b29b3 100644 --- a/source/render/occludedscene.h +++ b/source/render/occludedscene.h @@ -5,14 +5,15 @@ #include #include "blend.h" #include "depthtest.h" -#include "mesh.h" -#include "program.h" #include "query.h" #include "scene.h" namespace Msp { namespace GL { +class Mesh; +class Program; + /** A scene that performs occlusion queries on renderables to skip those that are entirely occluded by others. diff --git a/source/render/orderedscene.h b/source/render/orderedscene.h index 3e2974e9..e4a35afa 100644 --- a/source/render/orderedscene.h +++ b/source/render/orderedscene.h @@ -1,7 +1,7 @@ #ifndef MSP_GL_ORDEREDSCENE_H_ #define MSP_GL_ORDEREDSCENE_H_ -#include +#include #include "scene.h" namespace Msp { diff --git a/source/render/programdata.cpp b/source/render/programdata.cpp index 31fc8fa2..1dcac641 100644 --- a/source/render/programdata.cpp +++ b/source/render/programdata.cpp @@ -1,7 +1,5 @@ #include -#include #include -#include #include #include "buffer.h" #include "color.h" diff --git a/source/render/programdata.h b/source/render/programdata.h index 474ca4e8..e5c3e4f5 100644 --- a/source/render/programdata.h +++ b/source/render/programdata.h @@ -1,7 +1,6 @@ #ifndef MSP_GL_PROGRAMDATA_H_ #define MSP_GL_PROGRAMDATA_H_ -#include #include #include #include "datatype.h" @@ -21,7 +20,6 @@ public: }; class Buffer; -class BufferBackedUniformBlock; class PipelineState; class Program; class UniformBlock; diff --git a/source/render/renderable.h b/source/render/renderable.h index 4175dd81..022c8708 100644 --- a/source/render/renderable.h +++ b/source/render/renderable.h @@ -1,8 +1,6 @@ #ifndef MSP_GL_RENDERABLE_H_ #define MSP_GL_RENDERABLE_H_ -#include -#include #include #include "tag.h" diff --git a/source/render/renderer.cpp b/source/render/renderer.cpp index 1d729200..b142da75 100644 --- a/source/render/renderer.cpp +++ b/source/render/renderer.cpp @@ -2,8 +2,8 @@ #include "buffer.h" #include "camera.h" #include "clipping.h" -#include "deviceinfo.h" #include "error.h" +#include "framebuffer.h" #include "lighting.h" #include "material.h" #include "program.h" diff --git a/source/render/renderer.h b/source/render/renderer.h index 3e0e50d8..af9eac04 100644 --- a/source/render/renderer.h +++ b/source/render/renderer.h @@ -4,7 +4,6 @@ #include #include #include "commands.h" -#include "framebuffer.h" #include "matrix.h" #include "pipelinestate.h" #include "programdata.h" @@ -16,6 +15,7 @@ namespace GL { class Batch; class Buffer; class Camera; +union ClearValue; class Clipping; class Material; class Mesh; diff --git a/source/render/scene.cpp b/source/render/scene.cpp index 3c101b8a..87d8c423 100644 --- a/source/render/scene.cpp +++ b/source/render/scene.cpp @@ -1,5 +1,6 @@ #include #include +#include #include "camera.h" #include "objectinstance.h" #include "occludedscene.h" diff --git a/source/render/scene.h b/source/render/scene.h index fcf5d33e..b6895344 100644 --- a/source/render/scene.h +++ b/source/render/scene.h @@ -1,12 +1,11 @@ #ifndef MSP_GL_SCENE_H_ #define MSP_GL_SCENE_H_ -#include +#include #include #include #include "matrix.h" #include "renderable.h" -#include "vector.h" namespace Msp { namespace GL { diff --git a/source/render/sequence.cpp b/source/render/sequence.cpp index ef96a9e7..e0c333de 100644 --- a/source/render/sequence.cpp +++ b/source/render/sequence.cpp @@ -1,11 +1,9 @@ -#include #include -#include "blend.h" #include "error.h" -#include "framebuffer.h" #include "lighting.h" #include "postprocessor.h" #include "renderer.h" +#include "rendertarget.h" #include "sequence.h" #include "texture2d.h" diff --git a/source/render/sequence.h b/source/render/sequence.h index cfd14942..ebdb55dd 100644 --- a/source/render/sequence.h +++ b/source/render/sequence.h @@ -1,24 +1,20 @@ #ifndef MSP_GL_SEQUENCE_H_ #define MSP_GL_SEQUENCE_H_ -#include -#include +#include #include "blend.h" #include "depthtest.h" -#include "framebuffer.h" +#include "frameformat.h" #include "renderable.h" -#include "rendertarget.h" #include "stenciltest.h" -#include "texture2d.h" namespace Msp { namespace GL { -class Blend; -class Camera; class Clipping; class Lighting; class PostProcessor; +class RenderTarget; /** Top-level content class. Typically a Sequence is used as the content diff --git a/source/render/text.cpp b/source/render/text.cpp index b3d85deb..5305de4b 100644 --- a/source/render/text.cpp +++ b/source/render/text.cpp @@ -1,6 +1,7 @@ #include "meshbuilder.h" #include "program.h" #include "renderer.h" +#include "technique.h" #include "text.h" #include "texture2d.h" diff --git a/source/render/text.h b/source/render/text.h index dda0a4f0..0b4fa92c 100644 --- a/source/render/text.h +++ b/source/render/text.h @@ -5,7 +5,6 @@ #include "mesh.h" #include "object.h" #include "objectinstance.h" -#include "technique.h" namespace Msp { namespace GL { diff --git a/source/render/view.h b/source/render/view.h index df623c3a..155a6fa9 100644 --- a/source/render/view.h +++ b/source/render/view.h @@ -1,7 +1,7 @@ #ifndef MSP_GL_VIEW_H_ #define MSP_GL_VIEW_H_ -#include +#include #include "framebuffer.h" namespace Msp { diff --git a/source/render/windowview.h b/source/render/windowview.h index 8b6f1431..ee7c44dc 100644 --- a/source/render/windowview.h +++ b/source/render/windowview.h @@ -1,7 +1,6 @@ #ifndef MSP_GL_WINDOWVIEW_H_ #define MSP_GL_WINDOWVIEW_H_ -#include #include #include #include "view.h"