-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from nieznanysprawiciel/Rendering
Rendering - new media
- Loading branch information
Showing
65 changed files
with
2,505 additions
and
86 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -58,6 +58,7 @@ Documentation/ | |
*.log | ||
*.scc | ||
*.html | ||
*.orig | ||
|
||
# Visual C++ cache files | ||
ipch/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
/** | ||
@file Ellipse.cpp | ||
@author nieznanysprawiciel | ||
@copyright File is part of Sleeping Wombat Libraries. | ||
*/ | ||
#include "swGUI/Core/stdafx.h" | ||
|
||
#include "Ellipse.h" | ||
#include "swGUI/Core/Media/Geometry/EllipseGeometry.h" | ||
|
||
|
||
namespace sw { | ||
namespace gui | ||
{ | ||
|
||
|
||
// ================================ // | ||
// | ||
Ellipse::Ellipse() | ||
: m_strokeThickness( 1 ) | ||
{ | ||
Shape::SetWidth( 100 ); | ||
Shape::SetHeight( 100 ); | ||
|
||
auto rectGeom = std::make_shared< EllipseGeometry >(); | ||
rectGeom->SetWidth( GetSize().x ); | ||
rectGeom->SetHeight( GetSize().y ); | ||
rectGeom->SetThickness( m_strokeThickness ); | ||
|
||
SetGeometry( rectGeom ); | ||
} | ||
|
||
// ================================ // | ||
// | ||
void Ellipse::SetWidth ( float width ) | ||
{ | ||
Shape::SetWidth( width ); | ||
|
||
auto geom = std::static_pointer_cast< EllipseGeometry >( GetGeometry() ); | ||
geom->SetWidth( GetSize().x ); | ||
} | ||
|
||
// ================================ // | ||
// | ||
void Ellipse::SetHeight ( float height ) | ||
{ | ||
Shape::SetHeight( height ); | ||
|
||
auto geom = std::static_pointer_cast< EllipseGeometry >( GetGeometry() ); | ||
geom->SetHeight( GetSize().y ); | ||
} | ||
|
||
// ================================ // | ||
// | ||
void Ellipse::SetThickness ( float thickness ) | ||
{ | ||
m_strokeThickness = thickness; | ||
|
||
auto geom = std::static_pointer_cast< EllipseGeometry >( GetGeometry() ); | ||
geom->SetThickness( m_strokeThickness ); | ||
} | ||
|
||
|
||
|
||
} // gui | ||
} // sw | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
#pragma once | ||
/** | ||
@file Ellipse.h | ||
@author nieznanysprawiciel | ||
@copyright File is part of Sleeping Wombat Libraries. | ||
*/ | ||
|
||
#include "Shape.h" | ||
|
||
|
||
|
||
|
||
namespace sw { | ||
namespace gui | ||
{ | ||
|
||
/**@brief Draws ellipse shape. | ||
@ingroup Shapes | ||
@ingroup Controls*/ | ||
class Ellipse : public Shape | ||
{ | ||
RTTR_ENABLE( Shape ); | ||
RTTR_REGISTRATION_FRIEND; | ||
private: | ||
|
||
float m_strokeThickness; | ||
|
||
protected: | ||
public: | ||
|
||
explicit Ellipse (); | ||
virtual ~Ellipse () = default; | ||
|
||
|
||
virtual void SetWidth ( float width ) override; | ||
virtual void SetHeight ( float height ) override; | ||
void SetThickness ( float thickness ); | ||
|
||
}; | ||
|
||
DEFINE_OPTR_TYPE( Ellipse ); | ||
|
||
|
||
} // gui | ||
} // sw | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
/** | ||
@file AngleGradientBrush.cpp | ||
@author nieznanysprawiciel | ||
@copyright File is part of Sleeping Wombat Libraries. | ||
*/ | ||
|
||
|
||
#include "swGUI/Core/stdafx.h" | ||
#include "AngleGradientBrush.h" | ||
|
||
|
||
|
||
namespace sw { | ||
namespace gui | ||
{ | ||
|
||
// ================================ // | ||
// | ||
AngleGradientBrush::AngleGradientBrush() | ||
: GradientBrush( AngleGradientBrush::ConstantsSize() ) | ||
{ | ||
m_constants.GradientCenter = Position( 0.5f, 0.5f ); | ||
} | ||
|
||
|
||
// ================================ // | ||
// | ||
BufferRange AngleGradientBrush::BufferData () | ||
{ | ||
return PrepareBuffer( m_constants.GetView() ); | ||
} | ||
|
||
// ================================ // | ||
// | ||
filesystem::Path AngleGradientBrush::ShaderFunctionFile () | ||
{ | ||
return "$(CoreGUI-Shader-Dir)/Brush/AngleGradientBrush.psh"; | ||
} | ||
|
||
// ================================ // | ||
// | ||
void AngleGradientBrush::SetGradientCenter ( Point center ) | ||
{ | ||
m_constants.GradientCenter = center; | ||
|
||
InvalidateConstants(); | ||
} | ||
|
||
// ================================ // | ||
// | ||
Size AngleGradientBrush::ConstantsSize () const | ||
{ | ||
return sizeof( m_constants ); | ||
} | ||
|
||
|
||
} // gui | ||
} // sw |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
#pragma once | ||
/** | ||
@file AngleGradientBrush.h | ||
@author nieznanysprawiciel | ||
@copyright File is part of Sleeping Wombat Libraries. | ||
*/ | ||
|
||
|
||
|
||
#include "GradientBrush.h" | ||
|
||
#include "swCommonLib/Common/Buffers/StackBuffer.h" | ||
#include "swCommonLib/System/Path.h" | ||
#include "swGUI/Core/System/CommonTypes/CommonTypes.h" | ||
|
||
|
||
|
||
namespace sw { | ||
namespace gui | ||
{ | ||
|
||
|
||
/**@brief Draws angle gradient on @ref Geometry. | ||
@ingroup Brushes*/ | ||
class AngleGradientBrush : public GradientBrush | ||
{ | ||
RTTR_ENABLE( GradientBrush ); | ||
RTTR_REGISTRATION_FRIEND; | ||
public: | ||
|
||
struct Constants | ||
{ | ||
Point GradientCenter; | ||
}; | ||
|
||
private: | ||
protected: | ||
|
||
StackBuffer< Constants > m_constants; | ||
|
||
public: | ||
explicit AngleGradientBrush (); | ||
virtual ~AngleGradientBrush () = default; | ||
|
||
|
||
virtual BufferRange BufferData () override; | ||
virtual filesystem::Path ShaderFunctionFile () override; | ||
|
||
void SetGradientCenter ( Point center ); | ||
|
||
protected: | ||
|
||
virtual Size ConstantsSize () const override; | ||
}; | ||
|
||
DEFINE_PTR_TYPE( AngleGradientBrush ); | ||
|
||
|
||
} // gui | ||
} // sw | ||
|
Oops, something went wrong.