"L. Spiro Engine"
Classes | Typedefs | Enumerations | Functions | Variables

lse Namespace Reference

Classes

class  CCamera
 A standard camera. More...
class  CActor
 An actor is an entity with an orientation. More...
class  CEntity
 An entity is simply the most abstract form of a "thing" in the game world. More...
class  CKeyboard
 Manages keyboard input. More...
class  CKeyboardBuffer
 Buffer keyboard data until the next frame of the game is processed. More...
class  CMouse
class  CLightBase
 The base class for lights, which provides common functionality and data between all lights, such as diffuse colors, etc. More...
class  CEngine
class  CMeshInstance
 A mesh instance. More...
class  CModelInstance
 The base class for model instances. More...
class  CSceneManager
 A standard scene manager. More...
class  CState
 A state in the game. More...
class  CStateFactory
class  CStateMachine

Typedefs

typedef CSharedPtr< C2dObject > C2dObjectPtr
typedef CSharedPtr< CCameraCSharedCameraPtr
typedef CSharedPtr< CActorCActorPtr
typedef LSVOID(LSE_CALL * PfPresentFunc )(LSVOID *_pvParm)
typedef CActor Parent
typedef CSharedPtr< CDirLight > CDirLightPtr
typedef CSharedPtr< CLightBaseCLightBasePtr
typedef CVectorPoD
< CDrawableMeshInstance
*, LSUINT32, 1024UL > 
CDrawableMeshInstanceArray
typedef CSharedPtr
< CDrawableModelInstance > 
CDrawableModelInstancePtr
typedef CSharedPtr
< CModelInstance
CModelInstancePtr
typedef CSharedPtr< CSceneManagerCSceneManagerPtr

Enumerations

enum  LSE_CAM_TYPE { LSE_CT_PERSP, LSE_CT_ORTHO }
enum  LSE_ENTITY_TYPES {
  LSE_ET_ENTITY = 0, LSE_ET_ACTOR = (1UL << 0UL), LSE_ET_CAM = (1UL << 1UL), LSE_ET_MODELINST = (1UL << 2UL),
  LSE_ET_DRAWMODELINST = (1UL << 3UL), LSE_ET_MESHINST = (1UL << 4UL), LSE_ET_DIRLIGHT = (1UL << 5UL), LSE_ET_SPOTLIGHT = (1UL << 6UL),
  LSE_ET_POINTLIGHT = (1UL << 7UL), LSE_ET_2DOBJECT = (1UL << 8UL), LSE_ET_CUSTOM = 9UL
}
enum  LSE_LIGHT_TYPE { LSE_LT_DIRECTIONAL, LSE_LT_POINT, LSE_LT_SPOT, LSE_LT_NONE }
enum  LSE_MODEL_TYPES { LSE_MT_MODEL = (1UL << 0UL), LSE_MT_DRAWABLEMODEL = (1UL << 1UL) }
enum  LSE_GAMESTATES { LSE_GS_INVALID = -1, LSE_GS_DEFAULT = -2 }

Functions

LSE_CALL CGame ()
const CTime &LSE_CALL GetTime () const
const CTime &LSE_CALL GetRenderTime () const
virtual LSBOOL LSE_CALL IsPaused () const
LSINT32 LSE_CALL GetWidth () const
LSINT32 LSE_CALL GetHeight () const
LSREAL LSE_CALL GetWidthF () const
LSREAL LSE_CALL GetHeightF () const
LSREAL LSE_CALL GetHalfWidthF () const
LSREAL LSE_CALL GetHalfHeightF () const
LSBOOL LSE_CALL IsFullScreen () const
LSINT32 LSE_CALL GetCurStateId () const
CState *LSE_CALL GetCurState ()
CSoundManagerEx &LSE_CALL GetSoundMan ()
LSVOID LSE_CALL SetPresentFunc (PfPresentFunc _pfFunc, LSVOID *_pvUser)
virtual LSVOID LSE_CALL SetNextState (LSUINT32 _ui32Id, LSUINTPTR _uptrUser, LSBOOL _bForce=false)
virtual LSVOID LSE_CALL SetStateFactory (CStateFactory *_psfFactory)
virtual LSVOID LSE_CALL SetInitialMousePosition (LSINT32 _ui32X, LSINT32 _ui32Y)
CMouse &LSE_CALL GetHiDefMouse ()
CMouse &LSE_CALL GetLoDefMouse ()
virtual LSBOOL LSE_CALL SendInputToHiDefMouse () const
virtual LSVOID LSE_CALL SetSendInputToHiDefMouse (LSBOOL _bVal)
const CKeyboard &LSE_CALL GetKeyboard () const
LSVOID LSE_CALL SetKeyboardBuffer (CKeyboardBuffer *_pkbBuffer)
virtual LSBOOL LSE_CALL Tick ()
virtual LSVOID LSE_CALL UpdateTime ()
virtual LSVOID LSE_CALL SetScreenDimensions (LSINT32 _i32Width, LSINT32 _i32Height)
virtual LSVOID LSE_CALL SetActive (LSBOOL _bVal)
virtual LSBOOL LSE_CALL GetActive () const
virtual LSVOID LSE_CALL SetFullScreen (LSBOOL _bVal)
virtual LSVOID LSE_CALL Present ()
virtual LSVOID LSE_CALL Close ()
LSBOOL LSE_CALL IsClosing () const
LSBOOL LSE_CALL TickLogic ()
LSBOOL LSE_CALL SetState (LSUINT32 _ui32Id, LSUINTPTR _uptrUser, LSBOOL _bForce=false)
virtual LSUINT32 LSE_CALL EntityType () const
virtual LSE_LIGHT_TYPE LSE_CALL LightType () const
LSE_INLINE LSBOOL LSE_CALL CastsShadows () const
LSVOID LSE_CALL SetDir (const CVector3 &_vDir)
const CVector3 &LSE_CALL GetDir () const
LSVOID LSE_CALL MakeKDop (const CFrustum &_fFrustum, const CVector3 _vCorners[8])
const CCappedKDop< 13UL > &LSE_CALL KDop () const
LSE_INLINE const CMatrix4x4
&LSE_CALL 
ShadowProjMatrix () const
LSE_INLINE const CMatrix4x4
&LSE_CALL 
ShadowViewMatrix () const
virtual LSVOID LSE_CALL WorldDidChange () const
virtual LSUINT32 LSE_CALL ModelType () const
LSBOOL LSE_CALL AddMeshInFrustum (const CFrustum &_fFrustum, CDrawableMeshInstanceArray &_miaArray)
template<unsigned _uMax>
LSBOOL LSE_CALL AddMeshInKDop (const CCappedKDop< _uMax > &_ckdKDop, CDrawableMeshInstanceArray &_miaArray)
LSVOID LSE_CALL SetCastsShadow (LSBOOL _bValue)
LSVOID LSE_CALL SetVertexLighting (LSBOOL _bValue)
LSVOID LSE_CALL SetCellShading (LSBOOL _bValue)
LSVOID LSE_CALL SetCookTorranceShading (LSBOOL _bValue)
LSVOID LSE_CALL DebugRender ()
virtual CSharedModelPtr LSE_CALL GetModel (const LSCHAR *_pcPath) const
virtual CMeshInstance *LSE_CALL CreateMesh () const
virtual LSBOOL LSE_CALL LoadFinished ()
LSBOOL LSE_CALL Create2dWorld (LSREAL _fSize)
LSVOID LSE_CALL Reset ()
C2dObjectPtr LSE_CALL Create2dObject ()
LSVOID LSE_CALL Tick (LSUINT64 _ui64Time)
LSVOID LSE_CALL Draw ()
LSVOID LSE_CALL SetCamPos (LSREAL _fX, LSREAL _fY)

Variables

__pad0__
CCriticalSection m_csCriticalSection
CTime m_tTime
CTime m_tRenderTime
PfPresentFunc m_pfPresent
LSVOID * m_lpvPresentUser
LSINT32 m_i32Width
LSINT32 m_i32Height
LSBOOL m_bActive
LSBOOL m_bFullScreen
LSBOOL m_bHiDefInput
LSBOOL m_bTicked
LSBOOL m_bPaused
LSBOOL m_bClosing
LSBOOL m_bCostantTimeTicked
CKeyboard m_kKeyboard
CKeyboardBufferm_pkbKeyboardBuffer
CRand m_rRand
CStateMachine m_smStateMachine
CStateFactorym_psfStateFactory
struct {
   LSBOOL   lse::bSetNextState
   LSUINT32   lse::ui32Id
   LSUINTPTR   lse::uiptrUser
   LSBOOL   lse::bForce
m_sNextState
CMouse m_mHiDefMouse
CMouse m_mLoDefMouse
CSoundManagerEx * m_smeSoundMan
CAllocator m_aSoundManAllocator
CMatrix4x4 m_mProj
CMatrix4x4 m_mView
CVector3 m_vDir
LSBOOL m_bCastsShadows
CCappedKDop< 13UL > m_ckdKDop
CVector< CActorPtr, LSUINT32 > m_vActors
CCamera m_cCam
CQuadTree m_qtTree
CVector< CQuadTreeObject
*, LSUINT32 > 
m_vDrawnObjects
LSE_S_2P_SCREEN_UP
LSE_S_2P_SCREEN_DOWN
LSE_S_2P_SCREEN_LEFT
LSE_S_2P_SCREEN_RIGHT
LSE_S_4P_UP_LEFT
LSE_S_4P_UP_RIGHT
LSE_S_4P_BOTTOM_LEFT
LSE_S_4P_BOTTOM_RIGHT
LSE_S_TOTAL

Detailed Description

Copyright L. Spiro 2012 All rights reserved.

Written by: Shawn (L. Spiro) Wilcoxen

This code may not be sold or traded for any personal gain without express written consent. You may use this code in your own projects and modify it to suit your needs as long as this disclaimer remains intact. You may not take credit for having written this code.

Description: A single 2D object with a single bounding box/sphere/etc. Using the parenting properties of actors, multiple 2D objects can be combined to create more complex 2D objects and characters.

Copyright L. Spiro 2011 All rights reserved.

Written by: Shawn (L. Spiro) Wilcoxen

This code may not be sold or traded for any personal gain without express written consent. You may use this code in your own projects and modify it to suit your needs as long as this disclaimer remains intact. You may not take credit for having written this code.

Description: A standard camera.

Copyright L. Spiro 2011 All rights reserved.

Written by: Shawn (L. Spiro) Wilcoxen

This code may not be sold or traded for any personal gain without express written consent. You may use this code in your own projects and modify it to suit your needs as long as this disclaimer remains intact. You may not take credit for having written this code.

Description: An actor is an entity with an orientation. It is the basis for all objects that can exist within the physical game world. Most things inherit from this rather than from CEntity.

Copyright L. Spiro 2011 All rights reserved.

Written by: Shawn (L. Spiro) Wilcoxen

This code may not be sold or traded for any personal gain without express written consent. You may use this code in your own projects and modify it to suit your needs as long as this disclaimer remains intact. You may not take credit for having written this code.

Description: An entity is simply the most abstract form of a "thing" in the game world. This base class provides a parent/child system. All entities can be parented and have children.

Copyright L. Spiro 2011 All rights reserved.

Written by: Shawn (L. Spiro) Wilcoxen

This code may not be sold or traded for any personal gain without express written consent. You may use this code in your own projects and modify it to suit your needs as long as this disclaimer remains intact. You may not take credit for having written this code.

Description: Enumerates the types of entities known to the engine. Add custom entities after

Copyright L. Spiro 2011 All rights reserved.

Written by: Shawn (L. Spiro) Wilcoxen

This code may not be sold or traded for any personal gain without express written consent. You may use this code in your own projects and modify it to suit your needs as long as this disclaimer remains intact. You may not take credit for having written this code.

Description: The heart of the whole engine. A game class. This wraps together all the major features in the engine and runs the main game loop. It uses a state machine to manage states in a game. Inherit from this class to build your own game around this engine. The game is paused automatically when any state but the main state has focus. This does not stop the global timer from counting, but local timers will stop unless the state is flagged as non-interruptable. All virtual timers always stop when the game is flagged as being paused.

Copyright L. Spiro 2011 All rights reserved.

Written by: Shawn (L. Spiro) Wilcoxen

This code may not be sold or traded for any personal gain without express written consent. You may use this code in your own projects and modify it to suit your needs as long as this disclaimer remains intact. You may not take credit for having written this code.

Description: Keyboard input updated once per frame. Requires a helper CKeyboardBuffer object to gather input notifications between frames. Input data is buffered in the CKeyboardBuffer object and passed off to the keyboard.

Key information includes if the key is down, just released, just pressed, and how long it has been down.

Copyright L. Spiro 2011 All rights reserved.

Written by: Shawn (L. Spiro) Wilcoxen

This code may not be sold or traded for any personal gain without express written consent. You may use this code in your own projects and modify it to suit your needs as long as this disclaimer remains intact. You may not take credit for having written this code.

Description: Keyboard input has to be handled by the game on a frame-by-frame basis. But simply reading the keys each frame will cause lack of sensivity when keys are pressed and released before the next frame. Additionally, key timestamps will be off a bit. We use a buffer to store key events until the next frame, at which time we pass the buffered data off to the actual keyboard. Each key has an array of events. When passing the data off to the real keyboard, we remove the bottom index from each key. This allows all events to be processed in order on a per-frame basis and without missing any events.

This class provides the buffered key data. Each key contains an array of events. Each event contains the event information (key down or key up) and a timestamp.

Copyright L. Spiro 2011 All rights reserved.

Written by: Shawn (L. Spiro) Wilcoxen

This code may not be sold or traded for any personal gain without express written consent. You may use this code in your own projects and modify it to suit your needs as long as this disclaimer remains intact. You may not take credit for having written this code.

Description: Keyboard key codes.

Copyright L. Spiro 2011 All rights reserved.

Written by: Shawn (L. Spiro) Wilcoxen

This code may not be sold or traded for any personal gain without express written consent. You may use this code in your own projects and modify it to suit your needs as long as this disclaimer remains intact. You may not take credit for having written this code.

Description: A directional light.

Copyright L. Spiro 2011 All rights reserved.

Written by: Shawn (L. Spiro) Wilcoxen

This code may not be sold or traded for any personal gain without express written consent. You may use this code in your own projects and modify it to suit your needs as long as this disclaimer remains intact. You may not take credit for having written this code.

Description: The base class for lights, which provides common functionality and data between all lights, such as diffuse colors, etc.

Copyright L. Spiro 2011 All rights reserved.

Written by: Shawn (L. Spiro) Wilcoxen

This code may not be sold or traded for any personal gain without express written consent. You may use this code in your own projects and modify it to suit your needs as long as this disclaimer remains intact. You may not take credit for having written this code.

Description: A mesh instance that is drawable.

Copyright L. Spiro 2011 All rights reserved.

Written by: Shawn (L. Spiro) Wilcoxen

This code may not be sold or traded for any personal gain without express written consent. You may use this code in your own projects and modify it to suit your needs as long as this disclaimer remains intact. You may not take credit for having written this code.

Description: A drawable model instance.

Copyright L. Spiro 2011 All rights reserved.

Written by: Shawn (L. Spiro) Wilcoxen

This code may not be sold or traded for any personal gain without express written consent. You may use this code in your own projects and modify it to suit your needs as long as this disclaimer remains intact. You may not take credit for having written this code.

Description: A mesh instance. CMeshInstance and CModelInstance are both actors. CModelInstance acts as the parent of a tree of CMeshInstance objects, each inheriting transforms from their parents up to the main parent CModelInstance object. Meshes contain multiple "render parts" and a shared pointer to the main mesh they reference.

Copyright L. Spiro 2011 All rights reserved.

Written by: Shawn (L. Spiro) Wilcoxen

This code may not be sold or traded for any personal gain without express written consent. You may use this code in your own projects and modify it to suit your needs as long as this disclaimer remains intact. You may not take credit for having written this code.

Description: The base class for model instances.

Copyright L. Spiro 2012 All rights reserved.

Written by: Shawn (L. Spiro) Wilcoxen

This code may not be sold or traded for any personal gain without express written consent. You may use this code in your own projects and modify it to suit your needs as long as this disclaimer remains intact. You may not take credit for having written this code.

Description: A standard 2D scene manager. It holds all of the objects in a 2D game world. There can be multiple of these in a game at a time, but usually there is only one. An example of when you would want to use a second (or more) scene graph is when you want to layer a second scene over another.

Copyright L. Spiro 2011 All rights reserved.

Written by: Shawn (L. Spiro) Wilcoxen

This code may not be sold or traded for any personal gain without express written consent. You may use this code in your own projects and modify it to suit your needs as long as this disclaimer remains intact. You may not take credit for having written this code.

Description: A standard scene manager. It holds all of the objects in a game world. There can be multiple of these in a game at a time, but usually there is only one. An example of when you would want to use a second (or more) scene graph is when you want to layer a second scene over another.

Copyright L. Spiro 2011 All rights reserved.

Written by: Shawn (L. Spiro) Wilcoxen

This code may not be sold or traded for any personal gain without express written consent. You may use this code in your own projects and modify it to suit your needs as long as this disclaimer remains intact. You may not take credit for having written this code.

Description: The base class for all states. A state is any modular portion of the game, such as the main menu, options menu, credits screen, gameplay area, bonus stages, stage-select screen, etc. When created, Init() is called. When destroyed, Destroy() is called. Each frame the state is in focus, Tick() is called followed by Draw(). It keeps its own local time which it may use as it pleases. The local time counts starting from the time the state was created. Since it is local time, the state can reset it, tick it twice as fast, or whatever it pleases. DO NOT LOAD RESOURCES VIA THE CONSTRUCTOR. #1: Its local memory manager will not be initialized yet. #2: Resources frequently rely on data provided by the game class, which you will not have until Init() is called.

Copyright L. Spiro 2011 All rights reserved.

Written by: Shawn (L. Spiro) Wilcoxen

This code may not be sold or traded for any personal gain without express written consent. You may use this code in your own projects and modify it to suit your needs as long as this disclaimer remains intact. You may not take credit for having written this code.

Description: The base class for generating states. The default implementation generates predefined states. Inherit from this class to generate your own game-specific states. Generated states MUST be created with LSENEW.

Copyright L. Spiro 2011 All rights reserved.

Written by: Shawn (L. Spiro) Wilcoxen

This code may not be sold or traded for any personal gain without express written consent. You may use this code in your own projects and modify it to suit your needs as long as this disclaimer remains intact. You may not take credit for having written this code.

Description: A state machine just manages the current state(s). It keeps a stack of states such that the bottom state is the primary state while the top state is the active state. Only the active state is processed normally, although states may define for themselves whether or not they should not be processed when not on top (important for online games). 99% of the time only one state is in the stack. For a good example of what multiple states would be used, consider any game on Wii. At any time during gameplay it must be possible to show the disk-error screen or home menu. These screens are each separate states that would be stacked over the main state when called. Being above the main state, they would be processed/drawn instead of the main state (note that they would not both be on top at the same time, and so would not both be processed). The main state still needs to exist, but unless it is flagged as uninterruptable it will not be ticked/drawn. An uninterruptable state is ticked every frame of the game as long as it is alive. It is only drawn if it is on the top of the stack.


Typedef Documentation

typedef CSharedPtr<C2dObject> lse::C2dObjectPtr

A shared pointer to a 2D object.

typedef CSharedPtr<CActor> lse::CActorPtr

A shared pointer to an actor.

typedef CSharedPtr<CDirLight> lse::CDirLightPtr

A shared pointer to a directional light.

typedef CVectorPoD<CDrawableMeshInstance *, LSUINT32, 1024UL> lse::CDrawableMeshInstanceArray

An array of mesh instances.

typedef CSharedPtr<CDrawableModelInstance> lse::CDrawableModelInstancePtr

A shared pointer to a drawable model instance.

typedef CSharedPtr<CLightBase> lse::CLightBasePtr

A shared pointer to a light base.

A shared pointer to a drawable model instance.

typedef CSharedPtr<CSceneManager> lse::CSceneManagerPtr

A shared pointer to a scene graph.

typedef CSharedPtr<CCamera> lse::CSharedCameraPtr

A shared pointer to a camera.

typedef LSVOID(LSE_CALL * lse::PfPresentFunc)(LSVOID *_pvParm)

The type of function used to present the back buffer when we need. Presenting the back buffer to the screen.


Enumeration Type Documentation

Camera types.

Enumerator:
LSE_CT_PERSP 

A perspective camera.

LSE_CT_ORTHO 

An orthogonal camera.

Types of entities known to the engine. Support for more can easily be added.

Enumerator:
LSE_ET_ENTITY 

CEntity.

LSE_ET_ACTOR 

CActor.

LSE_ET_CAM 

CCamera.

LSE_ET_MODELINST 

CModelInstance.

LSE_ET_DRAWMODELINST 

CDrawableModelInstance.

LSE_ET_MESHINST 

CMeshInstance.

LSE_ET_DIRLIGHT 

CDirLight.

LSE_ET_SPOTLIGHT 

CSpotLight.

LSE_ET_POINTLIGHT 

CPointLight.

LSE_ET_2DOBJECT 

C2dObject.

LSE_ET_CUSTOM 

Add custom entities starting with this shift.

Predefined game states.

Light types.

Enumerator:
LSE_LT_DIRECTIONAL 

A directional light.

LSE_LT_POINT 

A point light.

LSE_LT_SPOT 

A spot light.

LSE_LT_NONE 

Light base class. Invalid.

Types of models.

Enumerator:
LSE_MT_MODEL 

A basic model instance.

LSE_MT_DRAWABLEMODEL 

A drawable model instance.


Function Documentation

LSBOOL LSE_CALL lse::AddMeshInFrustum ( const CFrustum &  _fFrustum,
CDrawableMeshInstanceArray &  _miaArray 
)

Adds the mesh instances that are within the given frustum to the given list. Returns true if any meshes were added.

Parameters:
_fFrustumThe frustum to check for meshes being inside.
_miaArrayThe list of meshes to which to add any that are fully or partially inside the given frustum.
Returns:
Returns true if any meshes were added to the given list.
template<unsigned _uMax>
LSBOOL LSE_CALL lse::CDrawableModelInstance::AddMeshInKDop ( const CCappedKDop< _uMax > &  _ckdKDop,
CDrawableMeshInstanceArray &  _miaArray 
)

Adds the mesh instances that are within the given k-DOP to the given list. Returns true if any meshes were added.

Parameters:
_ckdKDopThe k-DOP to check for meshes being inside.
_miaArrayThe list of meshes to which to add any that are fully or partially inside the given frustum.
Returns:
Returns true if any meshes were added to the given list.
LSE_INLINE LSBOOL LSE_CALL lse::CastsShadows ( ) const

Determines whether or not this light casts shadows.

Returns:
Returns true if this light casts shadows.
virtual LSVOID LSE_CALL lse::Close ( ) [virtual]

Stop the game.

C2dObjectPtr LSE_CALL lse::Create2dObject ( )

Creates a 2D object and returns a shared pointer to the object.

Returns:
Returns a shared pointer to a 2D object, which will be invalid if there was not enough memory to allocate the object.
LSBOOL LSE_CALL lse::Create2dWorld ( LSREAL  _fSize)

Creates the 2D world.

Parameters:
_fSizeSize of the 2D world.
Returns:
Returns true if the world was created.
virtual CMeshInstance* LSE_CALL lse::CreateMesh ( ) const [protected, virtual]

Creates a new mesh. Override to change the type of mesh it creates.

Returns:
Returns a new mesh.
LSVOID LSE_CALL lse::DebugRender ( )

Debug rendering.

LSVOID LSE_CALL lse::Draw ( )

Renders the scene.

LSUINT32 LSE_CALL lse::EntityType ( ) const [virtual]

Get the entity type.

Returns:
Returns the type mask for this entity.
virtual LSBOOL LSE_CALL lse::GetActive ( ) const [virtual]

Get the active flag.

const CState *LSE_CALL lse::GetCurState ( )

Gets a pointer to the current state.

/return Returns a pointer to the current state.

LSINT32 LSE_CALL lse::GetCurStateId ( ) const

Get the current state ID.

const CVector3& LSE_CALL lse::GetDir ( ) const

Gets the direction of the light.

Returns:
Returns a constant reference to the direction of the light.
LSE_INLINE LSREAL LSE_CALL lse::CGame::GetHalfHeightF ( ) const

Get the half-height of the screen.

Returns:
Returns the half-height of the screen as a real.
LSE_INLINE LSREAL LSE_CALL lse::CGame::GetHalfWidthF ( ) const

Get the half-width of the screen.

Returns:
Returns the half-width of the screen as a real.
LSINT32 LSE_CALL lse::GetHeight ( ) const

Get the height of the screen.

Returns:
Returns the height of the screen as an integer.
LSE_INLINE LSREAL LSE_CALL lse::CGame::GetHeightF ( ) const

Get the height of the screen.

Returns:
Returns the height of the screen as a real.
const CMouse &LSE_CALL lse::GetHiDefMouse ( )

Get the high-definition mouse for read and write.

Returns:
The high-definition mouse used for controlling the game environment

Get the high-definition mouse for read only.

Returns:
The high-definition mouse used for controlling the game environment.
const CKeyboard& LSE_CALL lse::GetKeyboard ( ) const

Get our keyboard.

Returns:
Returns the keyboard.
const CMouse &LSE_CALL lse::GetLoDefMouse ( )

Get the low-definition mouse for read and write.

Returns:
The low-definition mouse used for menus, etc.

Get the low-definition mouse for read only.

Returns:
The low-definition mouse used for menus, etc.
virtual CSharedModelPtr LSE_CALL lse::GetModel ( const LSCHAR *  _pcPath) const [protected, virtual]

Gets a shared pointer to a shared model. Override to change how the shared pointer is created.

Parameters:
_pcPathNULL-terminated path to the file to load.
Returns:
Returns a shared pointer to a model. If loading the model fails, an invalid pointer is returned.
LSE_INLINE const CTime &LSE_CALL lse::CGame::GetRenderTime ( ) const

Get the global rendering time value.

Returns:
Returns a constant reference to the rendering timer.
LSE_INLINE CSoundManagerEx &LSE_CALL lse::CGame::GetSoundMan ( )

Get the sound manager.

LSE_INLINE const CTime &LSE_CALL lse::CGame::GetTime ( ) const

Get the global time value. For a state's local time, use the state's m_tLocalTime member.

Returns:
Returns a constant reference to the logical timer.
LSINT32 LSE_CALL lse::GetWidth ( ) const

Get the width of the screen.

Returns:
Returns the width of the screen as an integer.
LSE_INLINE LSREAL LSE_CALL lse::CGame::GetWidthF ( ) const

Get the width of the screen.

Returns:
Returns the width of the screen as a real.
LSBOOL LSE_CALL lse::IsClosing ( ) const

Are we closing?

LSE_INLINE LSBOOL LSE_CALL lse::CGame::IsFullScreen ( ) const

Are we in full-screen mode?

Returns:
Returns true if in full-screen mode.
LSE_INLINE LSBOOL LSE_CALL lse::CGame::IsPaused ( ) const [virtual]

Are we paused?

const CCappedKDop<13UL>& LSE_CALL lse::KDop ( ) const

Gets the k-DOP of this directional light.

Returns:
Returns the k-DOP of this directional light.
virtual LSE_LIGHT_TYPE LSE_CALL lse::LightType ( ) const [virtual]

Gets the light type. Must be overridden.

Returns:
Returns the type of this light.
virtual LSBOOL LSE_CALL lse::LoadFinished ( ) [protected, virtual]

Called after a successful load. Override to change behavior.

Returns:
Returns false if any error occurred. The error should be printed to the debug console.
LSVOID LSE_CALL lse::MakeKDop ( const CFrustum &  _fFrustum,
const CVector3  _vCorners[8] 
)

Createe the k-DOP for this directional light based on the corner points of a frustum.

Parameters:
_fFrustumThe frustum.
_vCornersThe 8 corner points of the frustum.
virtual LSUINT32 LSE_CALL lse::ModelType ( ) const [virtual]

Gets the model type.

Returns:
Returns the model type mask for this model.
virtual LSVOID LSE_CALL lse::Present ( ) [virtual]

Present the back buffer to the screen.

LSVOID LSE_CALL lse::Reset ( )

Resets the entire scene back to scratch, releasing all memory used.

Reset everything. Clears all resources created by this instance.

Reset all contents.

virtual LSBOOL LSE_CALL lse::SendInputToHiDefMouse ( ) const [virtual]

Is input being sent to the high-definition mouse?

virtual LSVOID LSE_CALL lse::SetActive ( LSBOOL  _bVal) [virtual]

Set the active flag. This should be done only by the system.

Parameters:
_bValActive value.
LSVOID LSE_CALL lse::SetCamPos ( LSREAL  _fX,
LSREAL  _fY 
)

Sets the 2D camera's position in world coordinates.

Parameters:
_fXThe new X position of the camera.
_fYThe new Y position of the camera.
LSE_INLINE LSVOID LSE_CALL lse::CDrawableMeshInstance::SetCastsShadow ( LSBOOL  _bValue)

Sets whether or not all meshes in the model cast shadows.

Parameters:
_bValueIf non-zero, all meshes in the model will cast shadows, otherwise they will not.

Sets whether or not the object casts shadows.

Parameters:
_bValueIf non-zero, the mesh casts shadows. Otherwise it does not.
LSE_INLINE LSVOID LSE_CALL lse::CDrawableMeshInstance::SetCellShading ( LSBOOL  _bValue)

Sets whether or not all meshes in the model use cell shading.

Parameters:
_bValueIf non-zero, all meshes in the model will use cell shading, otherwise they will not.

Sets whether or not the object uses cell shading.

Parameters:
_bValueIf non-zero, the mesh uses cell shading. Otherwise it does not.
LSE_INLINE LSVOID LSE_CALL lse::CDrawableMeshInstance::SetCookTorranceShading ( LSBOOL  _bValue)

Sets whether or not all meshes in the model use Cook-Torrance shading.

Parameters:
_bValueIf non-zero, all meshes in the model will use Cook-Torrance shading, otherwise they will not.

Sets whether or not the object uses Cook-Torrance shading.

Parameters:
_bValueIf non-zero, the mesh uses Cook-Torrance shading. Otherwise it does not.
LSVOID LSE_CALL lse::SetDir ( const CVector3 &  _vDir)

Sets the direction of the light.

Parameters:
_vDirThe new direction of the light.
virtual LSVOID LSE_CALL lse::SetFullScreen ( LSBOOL  _bVal) [virtual]

Set the fullscreen flag. This should be done only by the system.

Parameters:
_bValFull-screen value.
virtual LSVOID LSE_CALL lse::SetInitialMousePosition ( LSINT32  _ui32X,
LSINT32  _ui32Y 
) [virtual]

Set the initial mouse positions. Should only be done by the system.

Parameters:
_ui32XX position of the mouse in screen coordinates.
_ui32YY position of the mouse in screen coordinates.
LSVOID LSE_CALL lse::SetKeyboardBuffer ( CKeyboardBuffer *  _pkbBuffer)

Set the keyboard buffer pointer. Needed for us to update our keyboard each tick.

Parameters:
PARMPointer to the keyboard buffer to be used to update our keyboard.
virtual LSVOID LSE_CALL lse::SetNextState ( LSUINT32  _ui32Id,
LSUINTPTR  _uptrUser,
LSBOOL  _bForce = false 
) [virtual]

Set the next state. State is set on the next frame, after the time and input have been updated.

Parameters:
_ui32IdID of the state. Can be one of the LSE_GS_* enumerated values or a user-defined per-game value. To generate per-game states (based off this ID), a custom state factory must be provided to this class.
_uptrUserUser-defined data to be sent to the state in its Init() function. This has no meaning to the engine.
_bForceIf the given state is already active, this value determines if it will be forcefully reloaded or not.
LSVOID LSE_CALL lse::SetPresentFunc ( PfPresentFunc  _pfFunc,
LSVOID *  _pvUser 
)

Set the function we use to present the back buffer. The game class does not present the back buffer under normal conditions, but the users may decide to force-present it under certain circumstances.

Parameters:
_pfFuncThe function pointer used to present the back buffer.
virtual LSVOID LSE_CALL lse::SetScreenDimensions ( LSINT32  _i32Width,
LSINT32  _i32Height 
) [virtual]

Set the width and height of the screen.

Parameters:
_i32WidthWidth of the screen in pixels.
_i32HeightHeight of the screen in pixels.
virtual LSVOID LSE_CALL lse::SetSendInputToHiDefMouse ( LSBOOL  _bVal) [virtual]

Set whether input is sent to the high-definition mouse.

Parameters:
_bValA non-zero value causes mouse input to be sent to thehigh-definition mouse. Otherwise input is sent to the low-definition mouse.
LSBOOL LSE_CALL lse::SetState ( LSUINT32  _ui32Id,
LSUINTPTR  _uptrUser,
LSBOOL  _bForce = false 
) [protected]

Set the next state.

Parameters:
_ui32IdID of the state to set.
_uptrUserUser-defined data to pass to the new state.
_bForceIf the new state and the current state are the same, setting this to false causes the state change to be abandoned, and the current state remains active.
Returns:
Returns false if a memory error occurred while trying to create the new state.
virtual LSVOID LSE_CALL lse::SetStateFactory ( CStateFactory *  _psfFactory) [virtual]

Set the state factory.

LSE_INLINE LSVOID LSE_CALL lse::CDrawableMeshInstance::SetVertexLighting ( LSBOOL  _bValue)

Sets whether or not all meshes in the model use vertex lighting.

Parameters:
_bValueIf non-zero, all meshes in the model will use vertex lighting, otherwise they will not.

Sets whether or not the object uses vertex lighting.

Parameters:
_bValueIf non-zero, the mesh uses vertex lighting. Otherwise it does not.
LSE_INLINE CMatrix4x4 &LSE_CALL lse::CDirLight::ShadowProjMatrix ( ) const

Gets the projection matrix for shadow mapping for read-only.

Returns:
Returns the projection matrix for shadow mapping.

Gets the projection matrix for shadow mapping for writing.

Returns:
Returns the projection matrix for shadow mapping.
LSE_INLINE CMatrix4x4 &LSE_CALL lse::CDirLight::ShadowViewMatrix ( ) const

Gets the view matrix for shadow mapping for read-only.

Returns:
Returns the view matrix for shadow mapping.

Gets the view matrix for shadow mapping for writing.

Returns:
Returns the view matrix for shadow mapping.
virtual LSBOOL LSE_CALL lse::Tick ( ) [virtual]

Tick a single frame. Not to be called by users.

LSVOID LSE_CALL lse::Tick ( LSUINT64  _ui64Time)

Advances the 2D scene by the given number of microseconds.

Parameters:
_ui64TimeNumber of microseconds by which to advance the scene.
LSBOOL LSE_CALL lse::TickLogic ( ) [protected]

Tick the game logic.

Returns:
Returns false if the game needs to close.
virtual LSVOID LSE_CALL lse::UpdateTime ( ) [virtual]

Update the time. Called at the start of every frame. Should never be called by states except in rare circumstances.

virtual LSVOID LSE_CALL lse::WorldDidChange ( ) const [protected, virtual]

Inform child classes that the world transform has changed.


Variable Documentation

A single render that takes the whole screen.

LSBOOL lse::bForce

If true, the state will be changed even if the current state ID matches the new state ID.

If true, the state will be changed on the next tick.

The bottom half of a 2-player render with the screen split horizontally.

The left half of a 2-player render with the screen split vertically.

The right half of a 2-player render with the screen split vertically.

The top half of a 2-player render with the screen split horizontally.

A quarter-screen render of a 4-way split screen in the lower-left part of the screen.

A quarter-screen render of a 4-way split screen in the lower-right part of the screen.

A quarter-screen render of a 4-way split screen in the upper-left part of the screen.

A quarter-screen render of a 4-way split screen in the upper-right part of the screen.

< Total screen types.

Sound manager allocator.

Are we active? Use fewer CPU resources if we are not.

Does this light cast shadows?

Are we closing?

If stepping by a constant amount of time, we need to keep track of the first cycle in which we ticked so that we do not call Draw() before that.

Are we in full-screen mode?

Should input be sent to the hi-definition mouse or the low-definition mouse? Hi-definition is used for 3D areas typically while the low-definition mouse is used for menu screens.

Are we paused?

Have we ticked yet?

The 2D camera used for rendering the scene.

CCappedKDop<13UL> lse::m_ckdKDop

The k-DOP bounding volume for this light.

CCriticalSection lse::m_csCriticalSection

Our critical section for thread safety.

LSINT32 lse::m_i32Width

Width and height of the screen.

Our keyboard.

Present function user value.

A high-resolution mouse for gameplay.

A low-resolution mouse for menus.

CMatrix4x4 lse::m_mProj

The projection matrix for shadow-map generation.

CMatrix4x4 lse::m_mView

The view matrix for shadow-map generation.

Present function.

Buffer for the keyboard.

State factory.

CQuadTree lse::m_qtTree

The quad-tree.

CSoundManagerEx* lse::m_smeSoundMan

The sound manager.

State machine.

Global time. This is for the rendering. The logic timer usually runs at a fixed interval, and is not synced with the rendering timer. The rendering timer should be used to determine how much time since the last frame, which is not the same as the amount of time since the last logical update.

CTime lse::m_tTime

Global time. This is for the logic.

CVector<CActorPtr, LSUINT32> lse::m_vActors

The master list of actors.

CVector3 lse::m_vDir

The light direction, cached

CVector<CQuadTreeObject *, LSUINT32> lse::m_vDrawnObjects

Array of objects that will be drawn this frame.

LSUINT32 lse::ui32Id

The new state ID.

LSUINTPTR lse::uiptrUser

Data to pass to the state.

 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator