Leviathan  0.8.0.0
Leviathan game engine
Leviathan::InputReceiver Class Referenceabstract

class to derive from when wanting to connect to input More...

#include <InputController.h>

Public Member Functions

DLLEXPORT InputReceiver ()
 
virtual DLLEXPORT ~InputReceiver ()
 
virtual DLLEXPORT void BeginNewReceiveQueue ()
 
virtual DLLEXPORT bool ReceiveInput (int32_t key, int modifiers, bool down)=0
 Called when the object receives a key press, return true when consumed. More...
 
virtual DLLEXPORT void ReceiveBlockedInput (int32_t key, int modifiers, bool down)=0
 
virtual DLLEXPORT bool OnMouseMove (int xmove, int ymove)=0
 when mouse is captured and is moved (relative movement is passed) More...
 
DLLEXPORT void _UnConnectParent (Lock &ownerlock)
 If ConnectedTo is not NULL notifies it that we are no longer valid. More...
 

Protected Member Functions

void _OnConnected (InputController *owner)
 
void _OnDisconnect (InputController *owner)
 

Protected Attributes

InputControllerConnectedTo
 

Detailed Description

class to derive from when wanting to connect to input

Definition at line 15 of file InputController.h.

Constructor & Destructor Documentation

◆ InputReceiver()

DLLEXPORT Leviathan::InputReceiver::InputReceiver ( )

Definition at line 101 of file InputController.cpp.

101  : ConnectedTo(nullptr){
102 
103 }
InputController * ConnectedTo

◆ ~InputReceiver()

Leviathan::InputReceiver::~InputReceiver ( )
virtual

Definition at line 105 of file InputController.cpp.

105  {
106  // tell owner that we no longer exist //
107  LEVIATHAN_ASSERT(!ConnectedTo, "InputReceiver not _UnConnectParent called");
108 }
InputController * ConnectedTo

Member Function Documentation

◆ _OnConnected()

void Leviathan::InputReceiver::_OnConnected ( InputController owner)
protected

Definition at line 118 of file InputController.cpp.

118  {
119  ConnectedTo = owner;
120 }
InputController * ConnectedTo

◆ _OnDisconnect()

void Leviathan::InputReceiver::_OnDisconnect ( InputController owner)
protected

Definition at line 122 of file InputController.cpp.

122  {
123  ConnectedTo = NULL;
124 }
InputController * ConnectedTo

◆ _UnConnectParent()

DLLEXPORT void InputReceiver::_UnConnectParent ( Lock ownerlock)

If ConnectedTo is not NULL notifies it that we are no longer valid.

Definition at line 110 of file InputController.cpp.

110  {
111 
112  if(ConnectedTo)
113  ConnectedTo->_OnChildUnlink(ownerlock, this);
114 
115  ConnectedTo = NULL;
116 }
virtual DLLEXPORT void _OnChildUnlink(Lock &guard, InputReceiver *child)
InputController * ConnectedTo

◆ BeginNewReceiveQueue()

DLLEXPORT void Leviathan::InputReceiver::BeginNewReceiveQueue ( )
virtual

called at the beginning of key press receive sequence (you shouldn't reset anything, since you will get blocked input if keys are released while the object isn't getting input

Definition at line 126 of file InputController.cpp.

126  {
127 
128 }

◆ OnMouseMove()

virtual DLLEXPORT bool Leviathan::InputReceiver::OnMouseMove ( int  xmove,
int  ymove 
)
pure virtual

when mouse is captured and is moved (relative movement is passed)

◆ ReceiveBlockedInput()

virtual DLLEXPORT void Leviathan::InputReceiver::ReceiveBlockedInput ( int32_t  key,
int  modifiers,
bool  down 
)
pure virtual

◆ ReceiveInput()

virtual DLLEXPORT bool Leviathan::InputReceiver::ReceiveInput ( int32_t  key,
int  modifiers,
bool  down 
)
pure virtual

Called when the object receives a key press, return true when consumed.

Member Data Documentation

◆ ConnectedTo

InputController* Leviathan::InputReceiver::ConnectedTo
protected

Definition at line 45 of file InputController.h.


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