Skip to content

Commit

Permalink
C++20 Modules Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
hugoam authored and Hugo Amiard committed Nov 21, 2023
1 parent 680a6a4 commit 009af74
Show file tree
Hide file tree
Showing 54 changed files with 202 additions and 460 deletions.
107 changes: 2 additions & 105 deletions example/00_tutorial/Forward.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,113 +4,10 @@

#include <infra/Config.h>

#include <infra/Forward.h>
#include <type/Forward.h>
#include <pool/Forward.h>
#include <refl/Forward.h>
#include <ecs/Forward.h>
#include <tree/Forward.h>
#include <srlz/Forward.h>
#include <math/Forward.h>
#include <geom/Forward.h>
#include <noise/Forward.h>
#include <wfc/Forward.h>
#include <fract/Forward.h>
#include <lang/Forward.h>
#include <ctx/Forward.h>
#include <ui/Forward.h>
#include <uio/Forward.h>
#include <snd/Forward.h>
#include <ctx-glfw/Forward.h>
#include <ui-vg/Forward.h>
#include <bgfx/Forward.h>
#include <gfx/Forward.h>
#include <gfx-pbr/Forward.h>
#include <gfx-obj/Forward.h>
#include <gfx-gltf/Forward.h>
#include <gfx-ui/Forward.h>
#include <tool/Forward.h>
#include <wfc-gfx/Forward.h>

#ifndef _00_TUTORIAL_EXPORT
#define _00_TUTORIAL_EXPORT MUD_IMPORT
#endif

enum class ShapeType : unsigned int;

enum class ShapeType : unsigned int;


class MyObject;

namespace std {



}

namespace mud {
namespace ui {



}
}

namespace glm {



}

namespace mud {
namespace gfx {



}
}

namespace json11 {



}

namespace mud {



}

namespace mud {
namespace detail {



}
}

namespace bgfx {



}

namespace bimg {



}

namespace toy {



}

namespace bx {



}

class MyObject;
16 changes: 0 additions & 16 deletions example/15_script/Forward.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,6 @@

#include <infra/Config.h>

#include <infra/Forward.h>
#include <type/Forward.h>
#include <pool/Forward.h>
#include <refl/Forward.h>
#include <ecs/Forward.h>
#include <tree/Forward.h>
#include <math/Forward.h>
#include <geom/Forward.h>
#include <lang/Forward.h>
#include <ctx/Forward.h>
#include <ui/Forward.h>
#include <uio/Forward.h>
#include <snd/Forward.h>
#include <bgfx/Forward.h>
#include <gfx/Forward.h>

#ifndef _15_SCRIPT_EXPORT
#define _15_SCRIPT_EXPORT MUD_IMPORT
#endif
Expand Down
6 changes: 0 additions & 6 deletions src/amalg/Forward.h
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@


#pragma once

#include <infra/Config.h>

#include <infra/Forward.h>
#include <type/Forward.h>
#include <pool/Forward.h>

#ifndef TWO_AMALG_EXPORT
#define TWO_AMALG_EXPORT TWO_IMPORT
#endif
Expand Down
10 changes: 0 additions & 10 deletions src/clrefl/Forward.h
Original file line number Diff line number Diff line change
@@ -1,21 +1,11 @@


#pragma once

#include <infra/Config.h>

#include <infra/Forward.h>
#include <type/Forward.h>
#include <pool/Forward.h>

#ifndef TWO_CLREFL_EXPORT
#define TWO_CLREFL_EXPORT TWO_IMPORT
#endif





namespace two {

}
Expand Down
3 changes: 0 additions & 3 deletions src/ctx-glfw/Forward.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@

#include <infra/Config.h>

#include <math/Forward.h>
#include <ctx/Forward.h>

#ifndef TWO_CTX_GLFW_EXPORT
#define TWO_CTX_GLFW_EXPORT TWO_IMPORT
#endif
Expand Down
19 changes: 7 additions & 12 deletions src/fract/Forward.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,20 @@

#include <infra/Config.h>

#include <infra/Forward.h>
#include <type/Forward.h>
#include <math/Forward.h>
#include <geom/Forward.h>

#ifndef TWO_FRACT_EXPORT
#define TWO_FRACT_EXPORT TWO_IMPORT
#endif

namespace two
{
enum class PatternSampling : unsigned int;
export_ enum class PatternSampling : unsigned int;

class Pixircle;
class Circlifier;
struct Pattern;
struct FractTab;
class Fract;
class FractSample;
export_ class Pixircle;
export_ class Circlifier;
export_ struct Pattern;
export_ struct FractTab;
export_ class Fract;
export_ class FractSample;
}

#ifdef TWO_META_GENERATOR
Expand Down
3 changes: 1 addition & 2 deletions src/fract/Fract.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,11 @@

module;
#include <infra/Cpp20.h>
module two.fract;

#define PI 3.14159f
#define COEFF_TRANS 1.5f
#define COEFF_ROTATION 15
#define COEFF_V 0.004
module two.fract;

float rnd_float()
{
Expand Down
4 changes: 2 additions & 2 deletions src/fract/Fract.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

namespace two
{
TWO_FRACT_EXPORT func_ void generate_fract(uvec2 resolution, const Pattern& pattern, Image256& output_image);
export_ TWO_FRACT_EXPORT func_ void generate_fract(uvec2 resolution, const Pattern& pattern, Image256& output_image);

typedef uint32_t(*PatternSampler)(const Pattern&, float, float, float);
export_ using PatternSampler = uint32_t(*)(const Pattern&, float, float, float);

export_ enum class refl_ PatternSampling : unsigned int
{
Expand Down
1 change: 1 addition & 0 deletions src/frame/Shell.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@

module;
#define BX_COMPILER_MSVC_CONFORMANCE
#include <infra/Cpp20.h>
#include <bx/allocator.h>
#include <bgfx/bgfx.h>
Expand Down
13 changes: 0 additions & 13 deletions src/gfx-edit/Forward.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,6 @@

#include <infra/Config.h>

#include <infra/Forward.h>
#include <type/Forward.h>
#include <refl/Forward.h>
#include <srlz/Forward.h>
#include <lang/Forward.h>
#include <math/Forward.h>
#include <geom/Forward.h>
#include <ui/Forward.h>
#include <uio/Forward.h>
#include <gfx/Forward.h>
#include <gfx-ui/Forward.h>
#include <gfx-pbr/Forward.h>

#ifndef TWO_GFX_EDIT_EXPORT
#define TWO_GFX_EDIT_EXPORT TWO_IMPORT
#endif
Expand Down
3 changes: 1 addition & 2 deletions src/gfx-ui/Forward.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ namespace two
{
namespace ui
{
enum class OrbitMode : int;

export_ enum class OrbitMode : int;
}
}

Expand Down
2 changes: 0 additions & 2 deletions src/gfx/Animation.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@

namespace two
{
#ifdef TWO_MODULES
using stl::string;
#endif

export_ enum class refl_ AnimTarget : unsigned int
{
Expand Down
76 changes: 35 additions & 41 deletions src/gltf/Forward.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,48 +2,42 @@

#include <infra/Config.h>

#include <infra/Forward.h>
#include <type/Forward.h>
#include <refl/Forward.h>
#include <srlz/Forward.h>
#include <math/Forward.h>

#ifndef TWO_GLTF_EXPORT
#define TWO_GLTF_EXPORT TWO_IMPORT
#endif

enum class glTFComponentType : unsigned int;
enum class glTFType : unsigned int;
enum class glTFPrimitiveType : unsigned int;
enum class glTFInterpolation : unsigned int;
enum class glTFAlphaMode : unsigned int;
struct glTFBuffer;
struct glTFImage;
struct glTFBufferView;
struct glTFSparseIndices;
struct glTFSparseValues;
struct glTFSparse;
struct glTFAccessor;
struct glTFSampler;
struct glTFTexture;
struct glTFSkin;
struct glTFAttributes;
struct glTFMorphTarget;
struct glTFPrimitive;
struct glTFMesh;
struct glTFPerspective;
struct glTFOrthographic;
struct glTFCamera;
struct glTFAnimationTarget;
struct glTFAnimationChannel;
struct glTFAnimationSampler;
struct glTFAnimation;
struct glTFTextureInfo;
struct glTFMaterialPBR;
struct glTFMaterial;
struct glTFNode;
struct glTFNodeExtras;
struct glTFScene;
struct glTF;
export_ enum class glTFComponentType : unsigned int;
export_ enum class glTFType : unsigned int;
export_ enum class glTFPrimitiveType : unsigned int;
export_ enum class glTFInterpolation : unsigned int;
export_ enum class glTFAlphaMode : unsigned int;


export_ struct glTFBuffer;
export_ struct glTFImage;
export_ struct glTFBufferView;
export_ struct glTFSparseIndices;
export_ struct glTFSparseValues;
export_ struct glTFSparse;
export_ struct glTFAccessor;
export_ struct glTFSampler;
export_ struct glTFTexture;
export_ struct glTFSkin;
export_ struct glTFAttributes;
export_ struct glTFMorphTarget;
export_ struct glTFPrimitive;
export_ struct glTFMesh;
export_ struct glTFPerspective;
export_ struct glTFOrthographic;
export_ struct glTFCamera;
export_ struct glTFAnimationTarget;
export_ struct glTFAnimationChannel;
export_ struct glTFAnimationSampler;
export_ struct glTFAnimation;
export_ struct glTFTextureInfo;
export_ struct glTFMaterialPBR;
export_ struct glTFMaterial;
export_ struct glTFNode;
export_ struct glTFNodeExtras;
export_ struct glTFScene;
export_ struct glTF;
3 changes: 2 additions & 1 deletion src/infra/Forward.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
#define TWO_INFRA_EXPORT TWO_IMPORT
#endif

#ifdef USE_STLnamespace stl
#ifdef USE_STL
namespace stl
{
template <class T> struct span;
template <class T, size_t Size> struct array;
Expand Down
2 changes: 2 additions & 0 deletions src/lang/lang.ixx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ module;

export module two.lang;

import <regex>;

export import two.infra;
export import two.type;
export import two.pool;
Expand Down
Loading

0 comments on commit 009af74

Please sign in to comment.