Pictel 2d 0.1
Game Engine Documentation
Public Member Functions | Protected Attributes | List of all members
engine::DrawableI Class Referenceabstract
Inheritance diagram for engine::DrawableI:
engine::DrawableSpriteI engine::DrawableTargetI

Public Member Functions

 DrawableI (float width, float height)
 
virtual bool CanDraw ()
 
virtual void SetScale (float val)
 
virtual float * GetScale ()
 
virtual void SetZPosition (float value)
 
virtual void SetAlpha (float val)
 
virtual float * GetAlpha ()
 
virtual void SetColorMod (Color4 mod)
 
virtual Color4GetColorMod ()
 
virtual void SetRotation (float, float, float)=0
 
virtual void GetRotation (float *, float *, float *)=0
 
virtual void SetRotateable (bool)=0
 
virtual void SetTexture (TextureI *texture)
 
virtual TextureIGetTexture ()
 
virtual bool IsFlippedHorizontally ()
 
virtual void SetFlippedHorizontally (bool value)
 
virtual RectGetTextureRect ()
 
virtual bool & GetAcceptsLight ()
 

Protected Attributes

TextureIm_texture
 
Rect m_textureRect
 
Color4 m_colorMod
 
float m_flipHorizontal
 
float m_scale
 
float m_alpha
 
float m_zPos
 
bool m_flippedHorizontally
 
bool m_acceptsLight
 
bool m_rotatable
 

Detailed Description

Declares an abstract interface for the final object that will be drawn using the EngineProviderI. Different backend for different libraries might declare differently working concrete instances. The values held here should be as close to the low-level rendering APIs as possible. Sometimes providing raw bytes when necessary for Metal, DirectX or OpenGL.

The drawable is usually composed of vertex data and texture data.

Member Function Documentation

◆ CanDraw()

virtual bool engine::DrawableI::CanDraw ( )
inlinevirtual

Can the sprite be drawn

Reimplemented in engine::DrawableSpriteI.

◆ GetAlpha()

virtual float * engine::DrawableI::GetAlpha ( )
inlinevirtual

Get the drawable alpha; 0-1

◆ GetColorMod()

virtual Color4 & engine::DrawableI::GetColorMod ( )
inlinevirtual

Get the color mod

◆ GetRotation()

virtual void engine::DrawableI::GetRotation ( float *  ,
float *  ,
float *   
)
pure virtual

Rotation, low-level

◆ GetScale()

virtual float * engine::DrawableI::GetScale ( )
inlinevirtual

Get the drawable scale

◆ GetTexture()

virtual TextureI * engine::DrawableI::GetTexture ( )
inlinevirtual

Get the drawable texture

Reimplemented in engine::DrawableTargetI.

◆ GetTextureRect()

virtual Rect & engine::DrawableI::GetTextureRect ( )
inlinevirtual

Get the texture rect that this sprite is in

◆ IsFlippedHorizontally()

virtual bool engine::DrawableI::IsFlippedHorizontally ( )
inlinevirtual

Should the rendered sprite be flipped horizontally

◆ SetAlpha()

virtual void engine::DrawableI::SetAlpha ( float  val)
inlinevirtual

Set the drawable alpha; 0-1

◆ SetColorMod()

virtual void engine::DrawableI::SetColorMod ( Color4  mod)
inlinevirtual

Set the color mod

◆ SetFlippedHorizontally()

virtual void engine::DrawableI::SetFlippedHorizontally ( bool  value)
inlinevirtual

Set the rendered sprite be flipped horizontally

◆ SetRotateable()

virtual void engine::DrawableI::SetRotateable ( bool  )
pure virtual

Rotatable

◆ SetRotation()

virtual void engine::DrawableI::SetRotation ( float  ,
float  ,
float   
)
pure virtual

Rotation, low-level

◆ SetScale()

virtual void engine::DrawableI::SetScale ( float  val)
inlinevirtual

Set the drawable scale

◆ SetTexture()

virtual void engine::DrawableI::SetTexture ( TextureI texture)
inlinevirtual

Set the drawable texture

◆ SetZPosition()

virtual void engine::DrawableI::SetZPosition ( float  value)
inlinevirtual

Set the z-axis position. Possible values range from 0.0 to 1.0, 0.0 being closest to the "camera" and 1.0 being further away. Of two object: one being at 1.0 and one being at 0.0 the one at 0.0 will overlap the one at 1.0.