From acaefb4c669f01855252818ef0a2958cbdababc3 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Thu, 30 Sep 2021 16:23:43 +0300 Subject: [PATCH] Clean up includes and forward declarations for the core classes --- source/core/batch.cpp | 3 --- source/core/buffer.h | 1 - source/core/bufferable.cpp | 2 -- source/core/clipplane.cpp | 2 -- source/core/clipplane.h | 1 - source/core/commands.h | 4 ++-- source/core/deviceinfo.cpp | 5 +++++ source/core/framebuffer.h | 1 - source/core/matrix.cpp | 3 +-- source/core/matrix.h | 1 - source/core/mesh.cpp | 5 ----- source/core/mesh.h | 2 ++ source/core/module.h | 2 ++ source/core/pipelinestate.h | 2 -- source/core/pixelformat.cpp | 1 - source/core/program.cpp | 5 ----- source/core/program.h | 2 +- source/core/sampler.cpp | 1 - source/core/texture.cpp | 1 - source/core/texture1d.h | 1 + source/core/texture2d.cpp | 1 - source/core/texture2d.h | 1 - source/core/texture2darray.cpp | 1 - source/core/texture3d.cpp | 1 - source/core/uniformblock.cpp | 5 ----- source/core/uniformblock.h | 7 ------- source/core/vertexarray.cpp | 5 ----- source/core/vertexarray.h | 6 ------ source/core/vertexformat.cpp | 4 ---- source/core/vertexsetup.cpp | 2 -- 30 files changed, 14 insertions(+), 64 deletions(-) diff --git a/source/core/batch.cpp b/source/core/batch.cpp index b882cf1b..48a49791 100644 --- a/source/core/batch.cpp +++ b/source/core/batch.cpp @@ -1,9 +1,6 @@ #include #include "batch.h" -#include "buffer.h" #include "error.h" -#include "mesh.h" -#include "vertexarray.h" using namespace std; diff --git a/source/core/buffer.h b/source/core/buffer.h index 0e183688..df570d7e 100644 --- a/source/core/buffer.h +++ b/source/core/buffer.h @@ -3,7 +3,6 @@ #include #include -#include namespace Msp { namespace GL { diff --git a/source/core/bufferable.cpp b/source/core/bufferable.cpp index 9c5120a4..abbde263 100644 --- a/source/core/bufferable.cpp +++ b/source/core/bufferable.cpp @@ -1,6 +1,4 @@ #include -#include -#include #include "buffer.h" #include "bufferable.h" diff --git a/source/core/clipplane.cpp b/source/core/clipplane.cpp index 3e0d5f66..fe784d25 100644 --- a/source/core/clipplane.cpp +++ b/source/core/clipplane.cpp @@ -1,7 +1,5 @@ #include #include "clipplane.h" -#include "gl.h" -#include "matrix.h" #include "programdata.h" namespace Msp { diff --git a/source/core/clipplane.h b/source/core/clipplane.h index 9160e526..2cf9b18b 100644 --- a/source/core/clipplane.h +++ b/source/core/clipplane.h @@ -6,7 +6,6 @@ namespace Msp { namespace GL { -class Matrix; class ProgramData; class ClipPlane diff --git a/source/core/commands.h b/source/core/commands.h index 6969b820..ca10f784 100644 --- a/source/core/commands.h +++ b/source/core/commands.h @@ -1,5 +1,5 @@ -#ifndef COMMANDS_H_ -#define COMMANDS_H_ +#ifndef MSP_GL_COMMANDS_H_ +#define MSP_GL_COMMANDS_H_ #include "framebuffer.h" diff --git a/source/core/deviceinfo.cpp b/source/core/deviceinfo.cpp index 93297a79..acbd0a73 100644 --- a/source/core/deviceinfo.cpp +++ b/source/core/deviceinfo.cpp @@ -1,3 +1,8 @@ +#include +#include +#include +#include +#include #include "deviceinfo.h" #include "gl.h" diff --git a/source/core/framebuffer.h b/source/core/framebuffer.h index 89407e8b..da828bf5 100644 --- a/source/core/framebuffer.h +++ b/source/core/framebuffer.h @@ -9,7 +9,6 @@ namespace Msp { namespace GL { -class Texture; class Texture2D; class Texture2DMultisample; class Texture3D; diff --git a/source/core/matrix.cpp b/source/core/matrix.cpp index 311958ab..0eb9e916 100644 --- a/source/core/matrix.cpp +++ b/source/core/matrix.cpp @@ -1,7 +1,6 @@ -#include #include +#include #include -#include "error.h" #include "matrix.h" using namespace std; diff --git a/source/core/matrix.h b/source/core/matrix.h index e2f1ada0..71531ef6 100644 --- a/source/core/matrix.h +++ b/source/core/matrix.h @@ -1,7 +1,6 @@ #ifndef MSP_GL_MATRIX_H_ #define MSP_GL_MATRIX_H_ -#include #include #include #include "vector.h" diff --git a/source/core/mesh.cpp b/source/core/mesh.cpp index 371b38b4..029c16e0 100644 --- a/source/core/mesh.cpp +++ b/source/core/mesh.cpp @@ -1,13 +1,8 @@ -#include -#include -#include -#include #include "buffer.h" #include "error.h" #include "mesh.h" #include "renderer.h" #include "resourcemanager.h" -#include "vertexsetup.h" using namespace std; diff --git a/source/core/mesh.h b/source/core/mesh.h index 0cebaa69..010289b0 100644 --- a/source/core/mesh.h +++ b/source/core/mesh.h @@ -1,6 +1,8 @@ #ifndef MSP_GL_MESH_H_ #define MSP_GL_MESH_H_ +#include +#include #include #include "batch.h" #include "cullface.h" diff --git a/source/core/module.h b/source/core/module.h index 14a57fe8..34553b44 100644 --- a/source/core/module.h +++ b/source/core/module.h @@ -1,7 +1,9 @@ #ifndef MSP_GL_MODULE_H_ #define MSP_GL_MODULE_H_ +#include #include +#include #include #include "datatype.h" #include "glsl/compiler.h" diff --git a/source/core/pipelinestate.h b/source/core/pipelinestate.h index 9573f9fe..68983d11 100644 --- a/source/core/pipelinestate.h +++ b/source/core/pipelinestate.h @@ -9,8 +9,6 @@ namespace Msp { namespace GL { class Blend; -class BufferBackedUniformBlock; -class DefaultUniformBlock; class DepthTest; class Framebuffer; class Program; diff --git a/source/core/pixelformat.cpp b/source/core/pixelformat.cpp index 6be6d7c9..11eb4081 100644 --- a/source/core/pixelformat.cpp +++ b/source/core/pixelformat.cpp @@ -5,7 +5,6 @@ #include #include #include -#include #include #include "pixelformat.h" diff --git a/source/core/program.cpp b/source/core/program.cpp index 35304554..b1516e2d 100644 --- a/source/core/program.cpp +++ b/source/core/program.cpp @@ -1,8 +1,5 @@ #include -#include #include -#include -#include #include #include #include @@ -15,10 +12,8 @@ #include #include #include -#include "buffer.h" #include "error.h" #include "program.h" -#include "resources.h" #include "glsl/compiler.h" using namespace std; diff --git a/source/core/program.h b/source/core/program.h index fb7fddde..41c5897d 100644 --- a/source/core/program.h +++ b/source/core/program.h @@ -1,12 +1,12 @@ #ifndef MSP_GL_PROGRAM_H_ #define MSP_GL_PROGRAM_H_ +#include #include #include #include #include "module.h" #include "reflectdata.h" -#include "vertexformat.h" namespace Msp { namespace GL { diff --git a/source/core/sampler.cpp b/source/core/sampler.cpp index c36e9852..5d012125 100644 --- a/source/core/sampler.cpp +++ b/source/core/sampler.cpp @@ -7,7 +7,6 @@ #include #include "error.h" #include "sampler.h" -#include "texture.h" using namespace std; diff --git a/source/core/texture.cpp b/source/core/texture.cpp index ef8b7eef..33a7b21b 100644 --- a/source/core/texture.cpp +++ b/source/core/texture.cpp @@ -5,7 +5,6 @@ #include #include "error.h" #include "resourcemanager.h" -#include "resources.h" #include "texture.h" using namespace std; diff --git a/source/core/texture1d.h b/source/core/texture1d.h index 241808c1..e77f6484 100644 --- a/source/core/texture1d.h +++ b/source/core/texture1d.h @@ -1,6 +1,7 @@ #ifndef MSP_GL_TEXTURE1D_H_ #define MSP_GL_TEXTURE1D_H_ +#include #include "texture.h" namespace Msp { diff --git a/source/core/texture2d.cpp b/source/core/texture2d.cpp index 6edbba0d..70a9528d 100644 --- a/source/core/texture2d.cpp +++ b/source/core/texture2d.cpp @@ -4,7 +4,6 @@ #include #include "buffer.h" #include "error.h" -#include "resources.h" #include "texture2d.h" using namespace std; diff --git a/source/core/texture2d.h b/source/core/texture2d.h index 58552f11..0ef4fc1f 100644 --- a/source/core/texture2d.h +++ b/source/core/texture2d.h @@ -2,7 +2,6 @@ #define MSP_GL_TEXTURE2D_H_ #include -#include #include #include "texture.h" diff --git a/source/core/texture2darray.cpp b/source/core/texture2darray.cpp index 3c54f7c0..1c7d363e 100644 --- a/source/core/texture2darray.cpp +++ b/source/core/texture2darray.cpp @@ -1,4 +1,3 @@ -#include #include #include "error.h" #include "texture2darray.h" diff --git a/source/core/texture3d.cpp b/source/core/texture3d.cpp index b8e728cf..c35d4574 100644 --- a/source/core/texture3d.cpp +++ b/source/core/texture3d.cpp @@ -3,7 +3,6 @@ #include #include #include -#include #include "error.h" #include "texture3d.h" diff --git a/source/core/uniformblock.cpp b/source/core/uniformblock.cpp index 8f85b87f..76d657a1 100644 --- a/source/core/uniformblock.cpp +++ b/source/core/uniformblock.cpp @@ -1,13 +1,8 @@ #include #include #include -#include "buffer.h" -#include "color.h" #include "deviceinfo.h" -#include "error.h" -#include "matrix.h" #include "uniformblock.h" -#include "vector.h" using namespace std; diff --git a/source/core/uniformblock.h b/source/core/uniformblock.h index 79e699fd..ec42089a 100644 --- a/source/core/uniformblock.h +++ b/source/core/uniformblock.h @@ -1,21 +1,14 @@ #ifndef MSP_GL_UNIFORMBLOCK_H_ #define MSP_GL_UNIFORMBLOCK_H_ -#include #include #include #include "bufferable.h" #include "reflectdata.h" -#include "vector.h" namespace Msp { namespace GL { -class BufferRange; -class Matrix; -class Uniform; -struct Color; - /** Stores uniforms with a specific layout. Both named and default uniform blocks are supported. diff --git a/source/core/vertexarray.cpp b/source/core/vertexarray.cpp index a13d79cc..30bc9bcc 100644 --- a/source/core/vertexarray.cpp +++ b/source/core/vertexarray.cpp @@ -1,9 +1,4 @@ -#include -#include -#include "buffer.h" #include "error.h" -#include "gl.h" -#include "mesh.h" #include "vertexarray.h" using namespace std; diff --git a/source/core/vertexarray.h b/source/core/vertexarray.h index 55ee8d24..290fa10c 100644 --- a/source/core/vertexarray.h +++ b/source/core/vertexarray.h @@ -1,21 +1,15 @@ #ifndef MSP_GL_VERTEXARRAY_H_ #define MSP_GL_VERTEXARRAY_H_ -#include #include -#include #include #include "bufferable.h" -#include "datatype.h" -#include "primitivetype.h" #include "vertexarraybuilder.h" #include "vertexformat.h" namespace Msp { namespace GL { -class Buffer; - /** Stores vertex data. diff --git a/source/core/vertexformat.cpp b/source/core/vertexformat.cpp index 8e358acd..b95da9d1 100644 --- a/source/core/vertexformat.cpp +++ b/source/core/vertexformat.cpp @@ -1,8 +1,4 @@ -#include -#include #include -#include -#include #include "error.h" #include "vertexformat.h" diff --git a/source/core/vertexsetup.cpp b/source/core/vertexsetup.cpp index 7c2fd87f..f73e2889 100644 --- a/source/core/vertexsetup.cpp +++ b/source/core/vertexsetup.cpp @@ -1,4 +1,3 @@ -#include #include #include #include @@ -10,7 +9,6 @@ #include "buffer.h" #include "deviceinfo.h" #include "error.h" -#include "gl.h" #include "vertexarray.h" #include "vertexsetup.h" -- 2.45.2