Vigilante Game Framework  1.0.0.8
A 2D/3D C++ Game Framework using SFML.
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
VBase Class Reference

Base class that any object that updates or renders (including VState) inherints from this class. More...

#include <VBase.h>

Inheritance diagram for VBase:
V3DObject VGroup VObject VPhysicsJointBase VPhysicsObject V3DModel V3DObjModel V3DBatchModelGroup VEmitter VPhysicsGroup VRenderGroup VRenderLayer VState VSubState V9Slice VBackdrop VGradient VParticle VShape VSprite VText VTile VTilemap VPhysicsAnchorBase VPhysicsGrooveJoint VPhysicsPhaseBase VPhysicsSimpleMotor

Public Member Functions

virtual void Destroy ()
 Destroys object and any data that must be destroyed.
 
virtual void Kill ()
 
virtual void Revive ()
 Revives the object by setting both alive and exists back to true.
 
virtual void Update (float dt)
 
virtual void Draw (sf::RenderTarget &RenderTarget)
 

Static Public Member Functions

static const wchar_t * VString (const char *fmt,...)
 
static void VLog (const char *fmt,...)
 
static void VLogError (const char *fmt,...)
 
static void VClearLog ()
 

Public Attributes

bool active = true
 Base can be updated using Update if true.
 
bool visible = true
 Base can be rendered using Draw if true.
 
bool alive = true
 Helper member that is mainly used filter out behaviours to objects which aren't alive in the scene.
 
bool exists = true
 Base can be updated and rendered if true, else it would no longer be treated as being part of the scene.
 
VType type = NONE
 Base object type, typically set in the constructor of an inherited object to specify what type it is.
 
uint32_t RefCount = 0
 Counts the amount of times the object is referenced in groups, ensures an object is only destroyed when no longer part of a single group.
 

Detailed Description

Base class that any object that updates or renders (including VState) inherints from this class.

Member Function Documentation

◆ Draw()

virtual void VBase::Draw ( sf::RenderTarget &  RenderTarget)
inlinevirtual

Draws object. (Default does nothing)

Parameters
RenderTargetThe game's sf::RenderTarget object to render data onto.

Reimplemented in VObject, VTilemap, VEmitter, VText, V3DModel, VGroup, VGradient, V3DObject, VSprite, VSubState, VShape, VRenderGroup, VTiledSprite, VBackdrop, V3DObjModel, V3DScene, V9Slice, VRenderLayer, VTrailArea, and V3DBatchModelGroup.

◆ Kill()

virtual void VBase::Kill ( )
inlinevirtual

Kills the object by alive to false, alive is also set to false so it will not render or update. To allow it to be rendered or updated, the function must be overridden so only alive is set to false.

Reimplemented in VEmitter, VGroup, and VRenderGroup.

◆ Update()

virtual void VBase::Update ( float  dt)
inlinevirtual

Updates object and any data it contains. (Default does nothing)

Parameters
dtDelta Time between the previous and current frame.

Reimplemented in VObject, VTilemap, VEmitter, VGroup, VTypedText, V3DObject, VSprite, VSubState, VPhysicsObject, VRenderGroup, VBackdrop, VPhysicsGroup, V3DScene, VState, VRenderLayer, VParticle, VTile, and VTextPath.

◆ VClearLog()

static void VBase::VClearLog ( )
static

Helper function that clears out the command line/terminal.

◆ VLog()

static void VBase::VLog ( const char *  fmt,
  ... 
)
static

Outputs text for logging purposes (to Console, Output Window ect...).

Parameters
fmtFormatted string that will be printed (for example: d will print an integer value).
...You must pass in all values of each specified type that are required for the formatted string.

◆ VLogError()

static void VBase::VLogError ( const char *  fmt,
  ... 
)
static

Outputs text for logging purposes (to Console, Output Window ect...) but will also throw a runtime error or show a popup window of the specific error.

Parameters
fmtFormatted string that will be printed (for example: d will print an integer value).
...You must pass in all values of each specified type that are required for the formatted string.

◆ VString()

static const wchar_t* VBase::VString ( const char *  fmt,
  ... 
)
static

Helper to create strings with format parameters.

Parameters
fmtFormatted string that will be printed (for example: d will print an integer value).
...You must pass in all values of each specified type that are required for the formatted string.

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