Added support for left mouse click

This commit is contained in:
Xawotihs
2010-10-10 21:57:27 +00:00
parent 0a484237b2
commit 75b8a0c328
4 changed files with 73 additions and 0 deletions

View File

@@ -262,9 +262,33 @@ void JGE::ResetInput()
{
while (!keyBuffer.empty()) keyBuffer.pop();
holds.clear();
LeftClickedProcessed();
}
void JGE::LeftClicked(int x, int y)
{
mLastLeftClickX = x;
mlastLeftClickY = y;
}
void JGE::LeftClickedProcessed()
{
mLastLeftClickX = -1;
mlastLeftClickY = -1;
}
bool JGE::GetLeftClickCoordinates(int& x, int& y)
{
if(mLastLeftClickX != -1 || mlastLeftClickY != -1)
{
x = mLastLeftClickX;
y = mlastLeftClickY;
return true;
}
return false;
}
JGE::JGE()
{
mApp = NULL;
@@ -295,6 +319,7 @@ void JGE::Init()
JRenderer::GetInstance();
JFileSystem::GetInstance();
JSoundSystem::GetInstance();
LeftClickedProcessed();
}
void JGE::SetDelta(float delta)