Browse Source

Forward declarations for Magnum namespace in Magnum.h header.

pull/7/head
Vladimír Vondruš 14 years ago
parent
commit
8f83485653
  1. 5
      doc/compilation-speedup.dox
  2. 6
      src/AbstractShaderProgram.h
  3. 4
      src/AbstractTexture.h
  4. 2
      src/Buffer.h
  5. 3
      src/BufferedTexture.h
  6. 3
      src/Color.h
  7. 2
      src/DimensionTraits.h
  8. 14
      src/Framebuffer.h
  9. 69
      src/Magnum.h
  10. 3
      src/Mesh.h
  11. 6
      src/ResourceManager.h
  12. 3
      src/TypeTraits.h

5
doc/compilation-speedup.dox

@ -17,7 +17,10 @@ Math/Vector3.h.
You are encouraged to use forward declarations also in your code. However, for
some types it can be too cumbersome -- e.g. too many template parameters,
typedefs etc. In this case a header with forward declarations is usually
available: see SceneGraph/SceneGraph.h for example.
available, each namespace has its own:
- Magnum.h
- SceneGraph/SceneGraph.h
@section compilation-speedup-templates Templates

6
src/AbstractShaderProgram.h

@ -19,7 +19,6 @@
* @brief Class Magnum::AbstractShaderProgram
*/
#include <cstdint>
#include <string>
#include <Containers/EnumSet.h>
@ -38,11 +37,6 @@ namespace Math {
template<std::size_t, class> class Vector;
}
template<class> class Color3;
template<class> class Color4;
class Context;
class Shader;
#ifndef DOXYGEN_GENERATING_OUTPUT
namespace Implementation {
template<class> struct Attribute;

4
src/AbstractTexture.h

@ -19,16 +19,12 @@
* @brief Class Magnum::AbstractTexture
*/
#include <cstdint>
#include "Magnum.h"
#include "Color.h"
#include "AbstractImage.h"
namespace Magnum {
class Context;
/**
@brief Base for textures

2
src/Buffer.h

@ -29,8 +29,6 @@
namespace Magnum {
class Context;
/**
@brief %Buffer

3
src/BufferedTexture.h

@ -26,9 +26,6 @@
#ifndef MAGNUM_TARGET_GLES
namespace Magnum {
class Buffer;
class Context;
/**
@brief Buffered texture

3
src/Color.h

@ -24,11 +24,10 @@
#include "Math/MathTypeTraits.h"
#include "Math/Math.h"
#include "Math/Vector4.h"
#include "Magnum.h"
namespace Magnum {
template<class T> class Color3;
#ifndef DOXYGEN_GENERATING_OUTPUT
namespace Implementation {

2
src/DimensionTraits.h

@ -15,8 +15,6 @@
GNU Lesser General Public License version 3 for more details.
*/
#include <cstdint>
#include "Magnum.h"
/** @file

14
src/Framebuffer.h

@ -29,20 +29,6 @@
namespace Magnum {
#ifndef MAGNUM_TARGET_GLES2
template<std::uint8_t> class BufferedImage;
#endif
template<std::uint8_t> class Image;
#ifndef MAGNUM_TARGET_GLES2
typedef BufferedImage<1> BufferedImage1D;
typedef BufferedImage<2> BufferedImage2D;
typedef BufferedImage<3> BufferedImage3D;
#endif
typedef Image<1> Image1D;
typedef Image<2> Image2D;
typedef Image<3> Image3D;
/** @nosubgrouping
@brief %Framebuffer

69
src/Magnum.h

@ -16,9 +16,11 @@
*/
/** @file
* @brief Basic definitions
* @brief Basic definitions and forward declarations for Magnum namespace
*/
#include <cstdint>
#include "magnumConfigure.h"
#ifndef MAGNUM_TARGET_GLES
@ -94,6 +96,71 @@ typedef Math::Matrix4<GLfloat> Matrix4;
using Math::deg;
using Math::rad;
/* Forward declarations for all types in root namespace */
class AbstractImage;
class AbstractShaderProgram;
class AbstractTexture;
class Buffer;
#ifndef MAGNUM_TARGET_GLES2
template<std::uint8_t> class BufferedImage;
typedef BufferedImage<1> BufferedImage1D;
typedef BufferedImage<2> BufferedImage2D;
typedef BufferedImage<3> BufferedImage3D;
#endif
#ifndef MAGNUM_TARGET_GLES
class BufferedTexture;
#endif
template<class> class Color3;
template<class> class Color4;
enum class Version: GLint;
class Context;
class Extension;
class CubeMapTexture;
#ifndef MAGNUM_TARGET_GLES
class CubeMapTextureArray;
#endif
class Framebuffer;
template<std::uint8_t> class Image;
typedef Image<1> Image1D;
typedef Image<2> Image2D;
typedef Image<3> Image3D;
template<std::uint8_t> class ImageWrapper;
typedef ImageWrapper<1> ImageWrapper1D;
typedef ImageWrapper<2> ImageWrapper2D;
typedef ImageWrapper<3> ImageWrapper3D;
class IndexedMesh;
class Mesh;
class Profiler;
class Query;
class Renderbuffer;
enum class ResourceState: std::uint8_t;
enum class ResourceDataState: std::uint8_t;
enum class ResourcePolicy: std::uint8_t;
template<class, class> class Resource;
template<class...> class ResourceManager;
class Shader;
template<std::uint8_t> class Texture;
#ifndef MAGNUM_TARGET_GLES
typedef Texture<1> Texture1D;
#endif
typedef Texture<2> Texture2D;
typedef Texture<3> Texture3D;
class Timeline;
}
#endif

3
src/Mesh.h

@ -27,9 +27,6 @@
namespace Magnum {
class Buffer;
class Context;
/**
@brief Non-indexed mesh

6
src/ResourceManager.h

@ -29,7 +29,7 @@ namespace Magnum {
*
* @see Resource::state(), ResourceManager::state()
*/
enum class ResourceState {
enum class ResourceState: std::uint8_t {
/** The resource is not yet loaded. */
NotLoaded,
@ -48,7 +48,7 @@ enum class ResourceState {
*
* @see ResourceManager::set()
*/
enum class ResourceDataState {
enum class ResourceDataState: std::uint8_t {
/**
* The resource can be changed by the manager in the future. This is
* slower, as Resource needs to ask the manager for new version every time
@ -70,7 +70,7 @@ enum class ResourceDataState {
@see ResourceManager::set(), ResourceManager::free()
*/
enum class ResourcePolicy {
enum class ResourcePolicy: std::uint8_t {
/** The resource will stay resident for whole lifetime of resource manager. */
Resident,

3
src/TypeTraits.h

@ -30,9 +30,6 @@ namespace Math {
template<std::size_t, class> class Vector;
}
template<class> class Color3;
template<class> class Color4;
/**
@brief Traits class for plain OpenGL types

Loading…
Cancel
Save