mirror of https://github.com/axmolengine/axmol.git
getAllTouches() in GLView
This commit is contained in:
parent
047025696c
commit
89ed897f47
|
@ -56,6 +56,21 @@ namespace {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static std::vector<Touch*> getAllTouchesVector()
|
||||||
|
{
|
||||||
|
std::vector<Touch*> ret;
|
||||||
|
int i;
|
||||||
|
int temp = g_indexBitsUsed;
|
||||||
|
|
||||||
|
for (i = 0; i < EventTouch::MAX_TOUCHES; i++) {
|
||||||
|
if ( temp & 0x00000001) {
|
||||||
|
ret.push_back(g_touches[i]);
|
||||||
|
}
|
||||||
|
temp >>= 1;
|
||||||
|
}
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
static void removeUsedIndexBit(int index)
|
static void removeUsedIndexBit(int index)
|
||||||
{
|
{
|
||||||
if (index < 0 || index >= EventTouch::MAX_TOUCHES)
|
if (index < 0 || index >= EventTouch::MAX_TOUCHES)
|
||||||
|
@ -423,6 +438,11 @@ const Rect& GLView::getViewPortRect() const
|
||||||
return _viewPortRect;
|
return _viewPortRect;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::vector<Touch*> GLView::getAllTouches() const
|
||||||
|
{
|
||||||
|
return getAllTouchesVector();
|
||||||
|
}
|
||||||
|
|
||||||
float GLView::getScaleX() const
|
float GLView::getScaleX() const
|
||||||
{
|
{
|
||||||
return _scaleX;
|
return _scaleX;
|
||||||
|
|
|
@ -221,6 +221,11 @@ public:
|
||||||
*/
|
*/
|
||||||
const Rect& getViewPortRect() const;
|
const Rect& getViewPortRect() const;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get list of all active touches
|
||||||
|
*/
|
||||||
|
std::vector<Touch*> getAllTouches() const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get scale factor of the horizontal direction.
|
* Get scale factor of the horizontal direction.
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in New Issue