Browse Source

Using `override` keyword in all places I can think of at this time.

pull/7/head
Vladimír Vondruš 14 years ago
parent
commit
e9329745e8
  1. 4
      src/Contexts/AbstractXWindowContext.h
  2. 10
      src/Contexts/EglContextHandler.h
  3. 4
      src/Contexts/GlutWindowContext.h
  4. 12
      src/Contexts/GlxContextHandler.h
  5. 4
      src/Contexts/Sdl2WindowContext.h
  6. 6
      src/Physics/AxisAlignedBox.h
  7. 6
      src/Physics/Box.h
  8. 8
      src/Physics/Capsule.h
  9. 6
      src/Physics/Line.h
  10. 2
      src/Physics/LineSegment.h
  11. 12
      src/Physics/Plane.h
  12. 6
      src/Physics/Point.h
  13. 8
      src/Physics/ShapeGroup.h
  14. 8
      src/Physics/Sphere.h

4
src/Contexts/AbstractXWindowContext.h

@ -33,6 +33,8 @@
#include "AbstractWindowContext.h" #include "AbstractWindowContext.h"
#include "AbstractContextHandler.h" #include "AbstractContextHandler.h"
#include "magnumCompatibility.h"
namespace Magnum { namespace Magnum {
class Context; class Context;
@ -67,7 +69,7 @@ class AbstractXWindowContext: public AbstractWindowContext {
*/ */
virtual ~AbstractXWindowContext() = 0; virtual ~AbstractXWindowContext() = 0;
int exec(); int exec() override;
/** @brief Exit application main loop */ /** @brief Exit application main loop */
inline void exit() { flags |= Flag::Exit; } inline void exit() { flags |= Flag::Exit; }

10
src/Contexts/EglContextHandler.h

@ -28,6 +28,8 @@
#include "AbstractContextHandler.h" #include "AbstractContextHandler.h"
#include "magnumCompatibility.h"
namespace Magnum { namespace Contexts { namespace Magnum { namespace Contexts {
#ifndef DOXYGEN_GENERATING_OUTPUT #ifndef DOXYGEN_GENERATING_OUTPUT
@ -48,14 +50,14 @@ class EglContextHandler: public AbstractContextHandler<EGLNativeDisplayType, Vis
public: public:
~EglContextHandler(); ~EglContextHandler();
VisualId getVisualId(EGLNativeDisplayType nativeDisplay); VisualId getVisualId(EGLNativeDisplayType nativeDisplay) override;
void createContext(EGLNativeWindowType nativeWindow); void createContext(EGLNativeWindowType nativeWindow) override;
inline void makeCurrent() { inline void makeCurrent() override {
eglMakeCurrent(display, surface, surface, context); eglMakeCurrent(display, surface, surface, context);
} }
inline void swapBuffers() { inline void swapBuffers() override {
eglSwapBuffers(display, surface); eglSwapBuffers(display, surface);
} }

4
src/Contexts/GlutWindowContext.h

@ -28,6 +28,8 @@
#include "AbstractWindowContext.h" #include "AbstractWindowContext.h"
#include "magnumCompatibility.h"
namespace Magnum { namespace Magnum {
class Context; class Context;
@ -58,7 +60,7 @@ class GlutWindowContext: public AbstractWindowContext {
~GlutWindowContext(); ~GlutWindowContext();
inline int exec() { inline int exec() override {
glutMainLoop(); glutMainLoop();
return 0; return 0;
} }

12
src/Contexts/GlxContextHandler.h

@ -27,6 +27,8 @@
#include "AbstractContextHandler.h" #include "AbstractContextHandler.h"
#include "magnumCompatibility.h"
namespace Magnum { namespace Contexts { namespace Magnum { namespace Contexts {
/** /**
@ -41,19 +43,19 @@ class GlxContextHandler: public AbstractContextHandler<Display*, VisualID, Windo
public: public:
~GlxContextHandler(); ~GlxContextHandler();
VisualID getVisualId(Display* nativeDisplay); VisualID getVisualId(Display* nativeDisplay) override;
void createContext(Window nativeWindow); void createContext(Window nativeWindow) override;
/* This must be enabled, otherwise (on my NVidia) it crashes when creating VAO. WTF. */ /* This must be enabled, otherwise (on my NVidia) it crashes when creating VAO. WTF. */
inline ExtensionWrangler::ExperimentalFeatures experimentalExtensionWranglerFeatures() const { inline ExtensionWrangler::ExperimentalFeatures experimentalExtensionWranglerFeatures() const override {
return ExtensionWrangler::ExperimentalFeatures::Enable; return ExtensionWrangler::ExperimentalFeatures::Enable;
} }
inline void makeCurrent() { inline void makeCurrent() override {
glXMakeCurrent(display, window, context); glXMakeCurrent(display, window, context);
} }
inline void swapBuffers() { inline void swapBuffers() override {
glXSwapBuffers(display, window); glXSwapBuffers(display, window);
} }

4
src/Contexts/Sdl2WindowContext.h

@ -28,6 +28,8 @@
#include "AbstractWindowContext.h" #include "AbstractWindowContext.h"
#include "magnumCompatibility.h"
namespace Magnum { namespace Magnum {
class Context; class Context;
@ -63,7 +65,7 @@ class Sdl2WindowContext: public AbstractWindowContext {
*/ */
~Sdl2WindowContext(); ~Sdl2WindowContext();
int exec(); int exec() override;
/** @{ @name Drawing functions */ /** @{ @name Drawing functions */

6
src/Physics/AxisAlignedBox.h

@ -22,6 +22,8 @@
#include "Math/Vector3.h" #include "Math/Vector3.h"
#include "AbstractShape.h" #include "AbstractShape.h"
#include "magnumCompatibility.h"
namespace Magnum { namespace Physics { namespace Magnum { namespace Physics {
/** /**
@ -34,11 +36,11 @@ template<std::uint8_t dimensions> class PHYSICS_EXPORT AxisAlignedBox: public Ab
/** @brief Constructor */ /** @brief Constructor */
inline AxisAlignedBox(const typename DimensionTraits<dimensions, GLfloat>::VectorType& position, const typename DimensionTraits<dimensions, GLfloat>::VectorType& size): _position(position), _transformedPosition(position), _size(size), _transformedSize(size) {} inline AxisAlignedBox(const typename DimensionTraits<dimensions, GLfloat>::VectorType& position, const typename DimensionTraits<dimensions, GLfloat>::VectorType& size): _position(position), _transformedPosition(position), _size(size), _transformedSize(size) {}
inline typename AbstractShape<dimensions>::Type type() const { inline typename AbstractShape<dimensions>::Type type() const override {
return AbstractShape<dimensions>::Type::AxisAlignedBox; return AbstractShape<dimensions>::Type::AxisAlignedBox;
} }
void applyTransformation(const typename DimensionTraits<dimensions, GLfloat>::MatrixType& transformation); void applyTransformation(const typename DimensionTraits<dimensions, GLfloat>::MatrixType& transformation) override;
/** @brief Position */ /** @brief Position */
inline typename DimensionTraits<dimensions, GLfloat>::VectorType position() const { inline typename DimensionTraits<dimensions, GLfloat>::VectorType position() const {

6
src/Physics/Box.h

@ -23,6 +23,8 @@
#include "Math/Matrix4.h" #include "Math/Matrix4.h"
#include "AbstractShape.h" #include "AbstractShape.h"
#include "magnumCompatibility.h"
namespace Magnum { namespace Physics { namespace Magnum { namespace Physics {
/** /**
@ -35,11 +37,11 @@ template<std::uint8_t dimensions> class PHYSICS_EXPORT Box: public AbstractShape
/** @brief Constructor */ /** @brief Constructor */
inline Box(const typename DimensionTraits<dimensions, GLfloat>::MatrixType& transformation): _transformation(transformation), _transformedTransformation(transformation) {} inline Box(const typename DimensionTraits<dimensions, GLfloat>::MatrixType& transformation): _transformation(transformation), _transformedTransformation(transformation) {}
inline typename AbstractShape<dimensions>::Type type() const { inline typename AbstractShape<dimensions>::Type type() const override {
return AbstractShape<dimensions>::Type::Box; return AbstractShape<dimensions>::Type::Box;
} }
void applyTransformation(const typename DimensionTraits<dimensions, GLfloat>::MatrixType& transformation); void applyTransformation(const typename DimensionTraits<dimensions, GLfloat>::MatrixType& transformation) override;
/** @brief Transformation */ /** @brief Transformation */
inline typename DimensionTraits<dimensions, GLfloat>::MatrixType transformation() const { inline typename DimensionTraits<dimensions, GLfloat>::MatrixType transformation() const {

8
src/Physics/Capsule.h

@ -22,6 +22,8 @@
#include "Math/Vector3.h" #include "Math/Vector3.h"
#include "AbstractShape.h" #include "AbstractShape.h"
#include "magnumCompatibility.h"
namespace Magnum { namespace Physics { namespace Magnum { namespace Physics {
template<std::uint8_t> class Point; template<std::uint8_t> class Point;
@ -39,13 +41,13 @@ template<std::uint8_t dimensions> class PHYSICS_EXPORT Capsule: public AbstractS
/** @brief Constructor */ /** @brief Constructor */
inline Capsule(const typename DimensionTraits<dimensions, GLfloat>::VectorType& a, const typename DimensionTraits<dimensions, GLfloat>::VectorType& b, float radius): _a(a), _transformedA(a), _b(b), _transformedB(b), _radius(radius), _transformedRadius(radius) {} inline Capsule(const typename DimensionTraits<dimensions, GLfloat>::VectorType& a, const typename DimensionTraits<dimensions, GLfloat>::VectorType& b, float radius): _a(a), _transformedA(a), _b(b), _transformedB(b), _radius(radius), _transformedRadius(radius) {}
inline typename AbstractShape<dimensions>::Type type() const { inline typename AbstractShape<dimensions>::Type type() const override {
return AbstractShape<dimensions>::Type::Capsule; return AbstractShape<dimensions>::Type::Capsule;
} }
void applyTransformation(const typename DimensionTraits<dimensions, GLfloat>::MatrixType& transformation); void applyTransformation(const typename DimensionTraits<dimensions, GLfloat>::MatrixType& transformation) override;
bool collides(const AbstractShape<dimensions>* other) const; bool collides(const AbstractShape<dimensions>* other) const override;
/** @brief Start point */ /** @brief Start point */
inline typename DimensionTraits<dimensions, GLfloat>::VectorType a() const { inline typename DimensionTraits<dimensions, GLfloat>::VectorType a() const {

6
src/Physics/Line.h

@ -22,6 +22,8 @@
#include "Math/Vector3.h" #include "Math/Vector3.h"
#include "AbstractShape.h" #include "AbstractShape.h"
#include "magnumCompatibility.h"
namespace Magnum { namespace Physics { namespace Magnum { namespace Physics {
/** /**
@ -35,11 +37,11 @@ template<std::uint8_t dimensions> class PHYSICS_EXPORT Line: public AbstractShap
/** @brief Constructor */ /** @brief Constructor */
inline Line(const typename DimensionTraits<dimensions, GLfloat>::VectorType& a, const typename DimensionTraits<dimensions, GLfloat>::VectorType& b): _a(a), _transformedA(a), _b(b), _transformedB(b) {} inline Line(const typename DimensionTraits<dimensions, GLfloat>::VectorType& a, const typename DimensionTraits<dimensions, GLfloat>::VectorType& b): _a(a), _transformedA(a), _b(b), _transformedB(b) {}
inline typename AbstractShape<dimensions>::Type type() const { inline typename AbstractShape<dimensions>::Type type() const override {
return AbstractShape<dimensions>::Type::Line; return AbstractShape<dimensions>::Type::Line;
} }
void applyTransformation(const typename DimensionTraits<dimensions, GLfloat>::MatrixType& transformation); void applyTransformation(const typename DimensionTraits<dimensions, GLfloat>::MatrixType& transformation) override;
/** @brief First point */ /** @brief First point */
inline typename DimensionTraits<dimensions, GLfloat>::VectorType a() const { inline typename DimensionTraits<dimensions, GLfloat>::VectorType a() const {

2
src/Physics/LineSegment.h

@ -33,7 +33,7 @@ template<std::uint8_t dimensions> class LineSegment: public Line<dimensions> {
/** @brief Constructor */ /** @brief Constructor */
inline LineSegment(const typename DimensionTraits<dimensions, GLfloat>::VectorType& a, const typename DimensionTraits<dimensions, GLfloat>::VectorType& b): Line<dimensions>(a, b) {} inline LineSegment(const typename DimensionTraits<dimensions, GLfloat>::VectorType& a, const typename DimensionTraits<dimensions, GLfloat>::VectorType& b): Line<dimensions>(a, b) {}
inline typename AbstractShape<dimensions>::Type type() const { inline typename AbstractShape<dimensions>::Type type() const override {
return AbstractShape<dimensions>::Type::LineSegment; return AbstractShape<dimensions>::Type::LineSegment;
} }
}; };

12
src/Physics/Plane.h

@ -22,6 +22,8 @@
#include "Math/Vector3.h" #include "Math/Vector3.h"
#include "AbstractShape.h" #include "AbstractShape.h"
#include "magnumCompatibility.h"
namespace Magnum { namespace Physics { namespace Magnum { namespace Physics {
template<std::uint8_t> class Line; template<std::uint8_t> class Line;
@ -35,14 +37,14 @@ class PHYSICS_EXPORT Plane: public AbstractShape<3> {
/** @brief Constructor */ /** @brief Constructor */
inline Plane(const Vector3& position, const Vector3& normal): _position(position), _transformedPosition(position), _normal(normal), _transformedNormal(normal) {} inline Plane(const Vector3& position, const Vector3& normal): _position(position), _transformedPosition(position), _normal(normal), _transformedNormal(normal) {}
inline Type type() const { return Type::Plane; } inline Type type() const override { return Type::Plane; }
#ifndef DOXYGEN_GENERATING_OUTPUT #ifndef DOXYGEN_GENERATING_OUTPUT
void applyTransformation(const Matrix4& transformation); void applyTransformation(const Matrix4& transformation) override;
bool collides(const AbstractShape<3>* other) const; bool collides(const AbstractShape<3>* other) const override;
#else #else
void applyTransformation(const typename DimensionTraits<dimensions, GLfloat>::MatrixType& transformation); void applyTransformation(const typename DimensionTraits<dimensions, GLfloat>::MatrixType& transformation) override;
bool collides(const AbstractShape* other) const; bool collides(const AbstractShape* other) const override;
#endif #endif
/** @brief Position */ /** @brief Position */

6
src/Physics/Point.h

@ -22,6 +22,8 @@
#include "Math/Vector3.h" #include "Math/Vector3.h"
#include "AbstractShape.h" #include "AbstractShape.h"
#include "magnumCompatibility.h"
namespace Magnum { namespace Physics { namespace Magnum { namespace Physics {
/** /**
@ -34,11 +36,11 @@ template<std::uint8_t dimensions> class PHYSICS_EXPORT Point: public AbstractSha
/** @brief Constructor */ /** @brief Constructor */
inline Point(const typename DimensionTraits<dimensions, GLfloat>::VectorType& position): _position(position), _transformedPosition(position) {} inline Point(const typename DimensionTraits<dimensions, GLfloat>::VectorType& position): _position(position), _transformedPosition(position) {}
inline typename AbstractShape<dimensions>::Type type() const { inline typename AbstractShape<dimensions>::Type type() const override {
return AbstractShape<dimensions>::Type::Point; return AbstractShape<dimensions>::Type::Point;
} }
void applyTransformation(const typename DimensionTraits<dimensions, GLfloat>::MatrixType& transformation); void applyTransformation(const typename DimensionTraits<dimensions, GLfloat>::MatrixType& transformation) override;
/** @brief Position */ /** @brief Position */
inline typename DimensionTraits<dimensions, GLfloat>::VectorType position() const { inline typename DimensionTraits<dimensions, GLfloat>::VectorType position() const {

8
src/Physics/ShapeGroup.h

@ -24,6 +24,8 @@
#include <type_traits> #include <type_traits>
#include <utility> #include <utility>
#include "magnumCompatibility.h"
namespace Magnum { namespace Physics { namespace Magnum { namespace Physics {
#ifndef DOXYGEN_GENERATING_OUTPUT #ifndef DOXYGEN_GENERATING_OUTPUT
@ -99,13 +101,13 @@ template<std::uint8_t dimensions> class PHYSICS_EXPORT ShapeGroup: public Abstra
/** @brief Move assignment */ /** @brief Move assignment */
ShapeGroup& operator=(ShapeGroup&& other); ShapeGroup& operator=(ShapeGroup&& other);
inline typename AbstractShape<dimensions>::Type type() const { inline typename AbstractShape<dimensions>::Type type() const override {
return AbstractShape<dimensions>::Type::ShapeGroup; return AbstractShape<dimensions>::Type::ShapeGroup;
} }
void applyTransformation(const typename DimensionTraits<dimensions, GLfloat>::MatrixType& transformation); void applyTransformation(const typename DimensionTraits<dimensions, GLfloat>::MatrixType& transformation) override;
bool collides(const AbstractShape<dimensions>* other) const; bool collides(const AbstractShape<dimensions>* other) const override;
/** /**
* @brief First object in the group * @brief First object in the group

8
src/Physics/Sphere.h

@ -22,6 +22,8 @@
#include "Math/Vector3.h" #include "Math/Vector3.h"
#include "AbstractShape.h" #include "AbstractShape.h"
#include "magnumCompatibility.h"
namespace Magnum { namespace Physics { namespace Magnum { namespace Physics {
template<std::uint8_t> class Line; template<std::uint8_t> class Line;
@ -40,13 +42,13 @@ template<std::uint8_t dimensions> class PHYSICS_EXPORT Sphere: public AbstractSh
/** @brief Constructor */ /** @brief Constructor */
inline Sphere(const typename DimensionTraits<dimensions, GLfloat>::VectorType& position, float radius): _position(position), _transformedPosition(position), _radius(radius), _transformedRadius(radius) {} inline Sphere(const typename DimensionTraits<dimensions, GLfloat>::VectorType& position, float radius): _position(position), _transformedPosition(position), _radius(radius), _transformedRadius(radius) {}
inline typename AbstractShape<dimensions>::Type type() const { inline typename AbstractShape<dimensions>::Type type() const override {
return AbstractShape<dimensions>::Type::Sphere; return AbstractShape<dimensions>::Type::Sphere;
} }
void applyTransformation(const typename DimensionTraits<dimensions, GLfloat>::MatrixType& transformation); void applyTransformation(const typename DimensionTraits<dimensions, GLfloat>::MatrixType& transformation) override;
bool collides(const AbstractShape<dimensions>* other) const; bool collides(const AbstractShape<dimensions>* other) const override;
/** @brief Position */ /** @brief Position */
inline typename DimensionTraits<dimensions, GLfloat>::VectorType position() const { inline typename DimensionTraits<dimensions, GLfloat>::VectorType position() const {

Loading…
Cancel
Save