SDL Breakout Engine  0.1.0
An implementation of a Breakout game using sdl, implemented with efficient resource management.
Public Member Functions | Protected Attributes | List of all members
GUIElement Class Reference

#include <GameObject.hpp>

Inheritance diagram for GUIElement:
GameObject Brick MovingGUIElement Ball

Public Member Functions

 GUIElement (const std::shared_ptr< TextureWrapper > &texture)
 
 GUIElement (const std::shared_ptr< TextureWrapper > &texture, const std::string &tag)
 
 GUIElement (const std::shared_ptr< TextureWrapper > &texture, const Vector3D &startPosition)
 
 GUIElement (const std::shared_ptr< TextureWrapper > &texture, const Vector3D &startPosition, const std::string &tag)
 
void Render (SDL_Renderer *renderer)
 
 GUIElement ()
 blank GUIElement More...
 
- Public Member Functions inherited from GameObject
 GameObject (const std::string &tag)
 
 GameObject (const Vector3D &position)
 
 GameObject (const Vector3D &position, const std::string &tag)
 
 GameObject (const Vector3D &position, const Vector3D &size)
 
 GameObject (const Vector3D &position, const Vector3D &size, const std::string &tag)
 
void Update (const Vector3D &position)
 
Vector3D GetSize ()
 
Vector3D GetSize () const
 
const Vector3D_GetPosition () const
 
void DebugRender (SDL_Renderer *renderer)
 
virtual void Hit (const std::string &tag)
 
 GameObject ()
 default constructor for a gameobject More...
 

Protected Attributes

std::shared_ptr< TextureWrappermTexture
 internal texture More...
 
SDL_Rect mDestination
 rectangle representing the bounding box More...
 
- Protected Attributes inherited from GameObject
int mWidth = 0
 internal width More...
 
int mHeight = 0
 internal height More...
 
Vector3D mPosition = Vector3D(0, 0, 0)
 internal position More...
 
Vector3D startPosition
 start position More...
 

Additional Inherited Members

- Public Attributes inherited from GameObject
std::string mTag = ""
 the name of this object, should be unique to other objects unless grouping is desired. More...
 
bool alive = true
 whether this object is alive or not. More...
 

Detailed Description

Basic renderable GameObject, thin extension of GameObject to handle rendering logic for users.

Constructor & Destructor Documentation

GUIElement::GUIElement ( const std::shared_ptr< TextureWrapper > &  texture)

Simplest constructure, nameless Element with a texture

Parameters
texturehow to render the element
Todo:
implement different forms of rendering strategies
GUIElement::GUIElement ( const std::shared_ptr< TextureWrapper > &  texture,
const std::string &  tag 
)

named gui element

Parameters
tagthe name, should be unique unless grouping is desired.
texturetexture
GUIElement::GUIElement ( const std::shared_ptr< TextureWrapper > &  texture,
const Vector3D startPosition 
)

More specific constructor that specifies a starting position.

Parameters
startPositionthe x,y coordinates of this element.
texturetexture
GUIElement::GUIElement ( const std::shared_ptr< TextureWrapper > &  texture,
const Vector3D startPosition,
const std::string &  tag 
)

create a named element that has an initial position.

Parameters
texturetexture
startPositionstartPosition
tagtag
GUIElement::GUIElement ( )
default

blank GUIElement

Member Function Documentation

void GUIElement::Render ( SDL_Renderer *  renderer)

Render this element to the given renderer.

Solely handles rectangles.

Parameters
rendererthe renderer to target.

Member Data Documentation

SDL_Rect GUIElement::mDestination
protected

rectangle representing the bounding box

std::shared_ptr<TextureWrapper> GUIElement::mTexture
protected

internal texture


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