Skip to content
This repository has been archived by the owner on Apr 16, 2022. It is now read-only.

Commit

Permalink
[Multimedia] Split module into Graphics and Shapes
Browse files Browse the repository at this point in the history
  • Loading branch information
Bromeon committed Jul 20, 2012
1 parent d66a5de commit 176bef9
Show file tree
Hide file tree
Showing 25 changed files with 77 additions and 42 deletions.
9 changes: 6 additions & 3 deletions doc/Documentation.hpp
Expand Up @@ -50,18 +50,21 @@
/// @defgroup Events Events
/// @brief Facilities for object-oriented event handling using callbacks.

/// @defgroup Graphics Graphics
/// @brief Miscellaneous graphics-related functionality, such as specialized sprites or color helpers.

/// @defgroup Math Math
/// @brief Mathematical functionality, such as random number generator or trigonometric wrappers.

/// @defgroup Multimedia Multimedia
/// @brief Miscellaneous SFML related functionality, such as shapes and colors.

/// @defgroup Particles Particles
/// @brief Contains a particle system based on sf::Texture. The module also provides several affector and emitter classes.

/// @defgroup Resources Resources
/// @brief Provides a resource manager for various resource types as well as the possibility to access them safely.

/// @defgroup Shapes Shapes
/// @brief Extensions for sf::Shape like concave shapes or predefined figures.

/// @defgroup Time Time
/// @brief Supplies classes to measure time. These are convenient wrappers around sf::Clock.

Expand Down
2 changes: 1 addition & 1 deletion examples/Action.cpp
@@ -1,6 +1,6 @@

#include <Thor/Events.hpp>
#include <Thor/Multimedia/ToString.hpp>
#include <Thor/Graphics/ToString.hpp>
#include <SFML/Window.hpp>
#include <iostream>

Expand Down
4 changes: 2 additions & 2 deletions examples/Shapes.cpp
@@ -1,11 +1,11 @@

#include <Thor/Multimedia.hpp>
#include <Thor/Shapes.hpp>
#include <SFML/Graphics.hpp>

int main()
{
// Create render window
sf::RenderWindow window(sf::VideoMode(600, 500), "Thor Multimedia", sf::Style::Close);
sf::RenderWindow window(sf::VideoMode(600, 500), "Thor Shapes", sf::Style::Close);
window.setVerticalSyncEnabled(true);

// Create a concave shape by directly inserting the polygon points
Expand Down
19 changes: 8 additions & 11 deletions include/Thor/Multimedia.hpp → include/Thor/Graphics.hpp
Expand Up @@ -24,17 +24,14 @@
/////////////////////////////////////////////////////////////////////////////////

/// @file
/// @brief Complete header for the Multimedia module
/// @brief Complete header for the Graphics module

#ifndef THOR_MODULE_MULTIMEDIA_HPP
#define THOR_MODULE_MULTIMEDIA_HPP
#ifndef THOR_MODULE_GRAPHICS_HPP
#define THOR_MODULE_GRAPHICS_HPP

#include <Thor/Multimedia/Arrow.hpp>
#include <Thor/Multimedia/BigTexture.hpp>
#include <Thor/Multimedia/BigSprite.hpp>
#include <Thor/Multimedia/Colors.hpp>
#include <Thor/Multimedia/ConcaveShape.hpp>
#include <Thor/Multimedia/Shapes.hpp>
#include <Thor/Multimedia/ToString.hpp>
#include <Thor/Graphics/BigTexture.hpp>
#include <Thor/Graphics/BigSprite.hpp>
#include <Thor/Graphics/Colors.hpp>
#include <Thor/Graphics/ToString.hpp>

#endif // THOR_MODULE_MULTIMEDIA_HPP
#endif // THOR_MODULE_GRAPHICS_HPP
Expand Up @@ -53,7 +53,7 @@ namespace thor
class BigTexture;


/// @addtogroup Multimedia
/// @addtogroup Graphics
/// @{

/// @brief Sprite using big textures.
Expand Down
Expand Up @@ -50,7 +50,7 @@ namespace sf
namespace thor
{

/// @addtogroup Multimedia
/// @addtogroup Graphics
/// @{

/// @brief Class for textures which are too big for sf::Texture.
Expand Down
Expand Up @@ -29,7 +29,7 @@
#ifndef THOR_COLORS_HPP
#define THOR_COLORS_HPP

#include <Thor/Multimedia/Detail/ColorImpl.hpp>
#include <Thor/Graphics/Detail/ColorImpl.hpp>
#include <Thor/Config.hpp>

#include <SFML/Graphics/Color.hpp>
Expand All @@ -45,7 +45,7 @@ namespace detail
} // namespace detail


/// @addtogroup Multimedia
/// @addtogroup Graphics
/// @{

/// @brief Blends the colors @a firstColor and @a secondColor, according to the given interpolation.
Expand Down
Expand Up @@ -62,7 +62,7 @@ namespace thor
template <typename T>
struct PolarVector2;

/// @addtogroup Multimedia
/// @addtogroup Graphics
/// @{

/// @brief Returns a std::string representation of sf::Color.
Expand Down Expand Up @@ -109,5 +109,5 @@ class StringConversionException : public aurora::Exception

} // namespace thor

#include <Thor/Multimedia/Detail/ToString.inl>
#include <Thor/Graphics/Detail/ToString.inl>
#endif // THOR_TOSTRING_HPP
2 changes: 1 addition & 1 deletion include/Thor/Particles/Affector.hpp
Expand Up @@ -30,7 +30,7 @@
#define THOR_AFFECTOR_HPP

#include <Thor/Particles/ParticleInterfaces.hpp>
#include <Thor/Multimedia/Colors.hpp>
#include <Thor/Graphics/Colors.hpp>
#include <Thor/Config.hpp>

#include <SFML/System/Time.hpp>
Expand Down
2 changes: 1 addition & 1 deletion include/Thor/Resources/Detail/ResourceKeyHelpers.hpp
Expand Up @@ -27,7 +27,7 @@
#define THOR_RESOURCEKEYHELPERS_HPP

#include <Thor/Resources/ResourceKey.hpp>
#include <Thor/Multimedia/ToString.hpp>
#include <Thor/Graphics/ToString.hpp>
#include <Thor/Config.hpp>

#include <SFML/Graphics/Color.hpp>
Expand Down
36 changes: 36 additions & 0 deletions include/Thor/Shapes.hpp
@@ -0,0 +1,36 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Thor C++ Library
// Copyright (c) 2011-2012 Jan Haller
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
//
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
//
// 1. The origin of this software must not be misrepresented; you must not
// claim that you wrote the original software. If you use this software
// in a product, an acknowledgment in the product documentation would be
// appreciated but is not required.
//
// 2. Altered source versions must be plainly marked as such, and must not be
// misrepresented as being the original software.
//
// 3. This notice may not be removed or altered from any source distribution.
//
/////////////////////////////////////////////////////////////////////////////////

/// @file
/// @brief Complete header for the Shapes module

#ifndef THOR_MODULE_SHAPES_HPP
#define THOR_MODULE_SHAPES_HPP

#include <Thor/Shapes/Arrow.hpp>
#include <Thor/Shapes/ConcaveShape.hpp>
#include <Thor/Shapes/Shapes.hpp>

#endif // THOR_MODULE_SHAPES_HPP
Expand Up @@ -39,7 +39,7 @@
namespace thor
{

/// @addtogroup Multimedia
/// @addtogroup Shapes
/// @{

/// @brief Drawable arrow class
Expand Down
Expand Up @@ -53,7 +53,7 @@ namespace sf
namespace thor
{

/// @addtogroup Multimedia
/// @addtogroup Shapes
/// @{

/// @brief Concave shape class
Expand Down
Expand Up @@ -48,7 +48,7 @@ namespace thor

class ConcaveShape;

/// @addtogroup Multimedia
/// @addtogroup Shapes
/// @{

/// @brief Namespace for predefined shapes
Expand Down
4 changes: 2 additions & 2 deletions src/Arrow.cpp
Expand Up @@ -23,8 +23,8 @@
//
/////////////////////////////////////////////////////////////////////////////////

#include <Thor/Multimedia/Arrow.hpp>
#include <Thor/Multimedia/Shapes.hpp>
#include <Thor/Shapes/Arrow.hpp>
#include <Thor/Shapes/Shapes.hpp>
#include <Thor/Vectors/VectorAlgebra2D.hpp>

#include <SFML/Graphics/RenderTarget.hpp>
Expand Down
4 changes: 2 additions & 2 deletions src/BigSprite.cpp
Expand Up @@ -23,8 +23,8 @@
//
/////////////////////////////////////////////////////////////////////////////////

#include <Thor/Multimedia/BigSprite.hpp>
#include <Thor/Multimedia/BigTexture.hpp>
#include <Thor/Graphics/BigSprite.hpp>
#include <Thor/Graphics/BigTexture.hpp>
#include <Aurora/Tools/ForEach.hpp>

#include <SFML/Graphics/RenderTarget.hpp>
Expand Down
2 changes: 1 addition & 1 deletion src/BigTexture.cpp
Expand Up @@ -23,7 +23,7 @@
//
/////////////////////////////////////////////////////////////////////////////////

#include <Thor/Multimedia/BigTexture.hpp>
#include <Thor/Graphics/BigTexture.hpp>

#include <SFML/Graphics/Sprite.hpp>
#include <SFML/Graphics/Image.hpp>
Expand Down
2 changes: 1 addition & 1 deletion src/ColorImpl.cpp
Expand Up @@ -23,7 +23,7 @@
//
/////////////////////////////////////////////////////////////////////////////////

#include <Thor/Multimedia/Detail/ColorImpl.hpp>
#include <Thor/Graphics/Detail/ColorImpl.hpp>

#include <cassert>

Expand Down
2 changes: 1 addition & 1 deletion src/Colors.cpp
Expand Up @@ -23,7 +23,7 @@
//
/////////////////////////////////////////////////////////////////////////////////

#include <Thor/Multimedia/Colors.hpp>
#include <Thor/Graphics/Colors.hpp>
#include <Aurora/Tools/ForEach.hpp>

#include <SFML/Graphics/Color.hpp>
Expand Down
4 changes: 2 additions & 2 deletions src/ConcaveShape.cpp
Expand Up @@ -23,8 +23,8 @@
//
/////////////////////////////////////////////////////////////////////////////////

#include <Thor/Multimedia/ConcaveShape.hpp>
#include <Thor/Multimedia/Shapes.hpp>
#include <Thor/Shapes/ConcaveShape.hpp>
#include <Thor/Shapes/Shapes.hpp>
#include <Thor/Math/Triangulation.hpp>
#include <Thor/Vectors/PolarVector.hpp>

Expand Down
2 changes: 1 addition & 1 deletion src/InputNames.cpp
Expand Up @@ -24,7 +24,7 @@
/////////////////////////////////////////////////////////////////////////////////

#include <Thor/Events/InputNames.hpp>
#include <Thor/Multimedia/ToString.hpp> // thor::StringConversionException
#include <Thor/Graphics/ToString.hpp> // thor::StringConversionException

#include <Aurora/Tools/Metaprogramming.hpp>

Expand Down
5 changes: 2 additions & 3 deletions src/Shapes.cpp
Expand Up @@ -23,9 +23,8 @@
//
/////////////////////////////////////////////////////////////////////////////////


#include <Thor/Multimedia/Shapes.hpp>
#include <Thor/Multimedia/ConcaveShape.hpp>
#include <Thor/Shapes/Shapes.hpp>
#include <Thor/Shapes/ConcaveShape.hpp>
#include <Thor/Vectors/PolarVector.hpp>

#include <SFML/Graphics/ConvexShape.hpp>
Expand Down
2 changes: 1 addition & 1 deletion src/ToString.cpp
Expand Up @@ -23,7 +23,7 @@
//
/////////////////////////////////////////////////////////////////////////////////

#include <Thor/Multimedia/ToString.hpp>
#include <Thor/Graphics/ToString.hpp>

#include <SFML/Graphics/Color.hpp>

Expand Down

0 comments on commit 176bef9

Please sign in to comment.