GameKit  0.0.1a
C++ gamedev tools
Public Member Functions | Private Member Functions | Private Attributes | List of all members
gk::RectangleShape Class Reference

#include <RectangleShape.hpp>

Inheritance diagram for gk::RectangleShape:
gk::IDrawable gk::Transformable

Public Member Functions

 RectangleShape ()
 
 RectangleShape (float width, float height, const Color &color=Color::White)
 
const Colorcolor () const
 
void setColor (const Color &color)
 
void setWireframeMode (bool wireframeMode)
 
float width () const
 
float height () const
 
Vector2f getSize () const
 
void setSize (float width, float height)
 
void setOutlineColor (const Color &color)
 
void setOutlineThickness (int outlineThickness)
 
- Public Member Functions inherited from gk::IDrawable
virtual ~IDrawable ()=default
 Virtual destructor. More...
 
- Public Member Functions inherited from gk::Transformable
virtual ~Transformable ()=default
 
void setPosition (float x, float y, float z=0)
 
void setPosition (const Vector3f &position)
 
void setOrigin (float x, float y, float z=0)
 
void setOrigin (const Vector3f &origin)
 
void setScale (float factorX, float factorY, float factorZ=1)
 
void setScale (const Vector3f &factors)
 
void setRotation (float angle)
 
void setRotation (float angle, const Vector3f &axis)
 
const Vector3fgetPosition () const
 
const Vector3fgetOrigin () const
 
const Vector3fgetScale () const
 
float getRotation () const
 
void move (float offsetX, float offsetY, float offsetZ=0)
 
void move (const Vector3f &offset)
 
void scale (float factorX, float factorY, float factorZ=1)
 
void scale (const Vector3f &factor)
 
void rotate (float angle)
 
void rotate (float angle, const Vector3f &axis)
 
const TransformgetTransform () const
 

Private Member Functions

void updateVertexBuffer () const
 
void draw (RenderTarget &target, RenderStates states) const override
 Draw the object to a render target. More...
 

Private Attributes

Color m_color
 
bool m_wireframeMode = false
 
float m_width = 0
 
float m_height = 0
 
VertexBuffer m_vbo
 
Color m_outlineColor {Color::White}
 
int m_outlineThickness = 0
 
std::array< GLubyte, 6 *5 > m_indices
 

Additional Inherited Members

Detailed Description

Definition at line 26 of file RectangleShape.hpp.

Constructor & Destructor Documentation

§ RectangleShape() [1/2]

gk::RectangleShape::RectangleShape ( )

Definition at line 24 of file RectangleShape.cpp.

§ RectangleShape() [2/2]

gk::RectangleShape::RectangleShape ( float  width,
float  height,
const Color color = Color::White 
)

Definition at line 32 of file RectangleShape.cpp.

Member Function Documentation

§ color()

const Color& gk::RectangleShape::color ( ) const
inline

Definition at line 31 of file RectangleShape.hpp.

§ draw()

void gk::RectangleShape::draw ( RenderTarget target,
RenderStates  states 
) const
overrideprivatevirtual

Draw the object to a render target.

This is a pure virtual function that has to be implemented by the derived class to define how the drawable should be drawn.

Parameters
targetRender target to draw to
statesCurrent render states

Implements gk::IDrawable.

Definition at line 91 of file RectangleShape.cpp.

§ getSize()

Vector2f gk::RectangleShape::getSize ( ) const
inline

Definition at line 39 of file RectangleShape.hpp.

§ height()

float gk::RectangleShape::height ( ) const
inline

Definition at line 37 of file RectangleShape.hpp.

§ setColor()

void gk::RectangleShape::setColor ( const Color color)
inline

Definition at line 32 of file RectangleShape.hpp.

§ setOutlineColor()

void gk::RectangleShape::setOutlineColor ( const Color color)
inline

Definition at line 43 of file RectangleShape.hpp.

§ setOutlineThickness()

void gk::RectangleShape::setOutlineThickness ( int  outlineThickness)
inline

Definition at line 44 of file RectangleShape.hpp.

§ setSize()

void gk::RectangleShape::setSize ( float  width,
float  height 
)
inline

Definition at line 41 of file RectangleShape.hpp.

§ setWireframeMode()

void gk::RectangleShape::setWireframeMode ( bool  wireframeMode)
inline

Definition at line 34 of file RectangleShape.hpp.

§ updateVertexBuffer()

void gk::RectangleShape::updateVertexBuffer ( ) const
private

Definition at line 38 of file RectangleShape.cpp.

§ width()

float gk::RectangleShape::width ( ) const
inline

Definition at line 36 of file RectangleShape.hpp.

Member Data Documentation

§ m_color

Color gk::RectangleShape::m_color
private

Definition at line 51 of file RectangleShape.hpp.

§ m_height

float gk::RectangleShape::m_height = 0
private

Definition at line 56 of file RectangleShape.hpp.

§ m_indices

std::array<GLubyte, 6 * 5> gk::RectangleShape::m_indices
private
Initial value:
{
0, 1, 3,
3, 1, 2
}

Definition at line 63 of file RectangleShape.hpp.

§ m_outlineColor

Color gk::RectangleShape::m_outlineColor {Color::White}
private

Definition at line 60 of file RectangleShape.hpp.

§ m_outlineThickness

int gk::RectangleShape::m_outlineThickness = 0
private

Definition at line 61 of file RectangleShape.hpp.

§ m_vbo

VertexBuffer gk::RectangleShape::m_vbo
private

Definition at line 58 of file RectangleShape.hpp.

§ m_width

float gk::RectangleShape::m_width = 0
private

Definition at line 55 of file RectangleShape.hpp.

§ m_wireframeMode

bool gk::RectangleShape::m_wireframeMode = false
private

Definition at line 53 of file RectangleShape.hpp.


The documentation for this class was generated from the following files: