mirror of https://github.com/axmolengine/axmol.git
start of input queue support
This commit is contained in:
parent
12b01dcb25
commit
9cf463bf6a
|
@ -515,4 +515,10 @@ void GLView::UpdateForWindowSizeChange()
|
|||
}
|
||||
}
|
||||
|
||||
void GLView::QueueEvent(std::shared_ptr<InputEvent>& event)
|
||||
{
|
||||
std::lock_guard<std::mutex> guard(mMutex);
|
||||
mInputEvents.push(event);
|
||||
}
|
||||
|
||||
NS_CC_END
|
||||
|
|
|
@ -29,6 +29,7 @@ THE SOFTWARE.
|
|||
#include "CCStdC.h"
|
||||
#include "CCGL.h"
|
||||
#include "platform/CCCommon.h"
|
||||
#include "InputEvent.h"
|
||||
#include "CCGeometry.h"
|
||||
#include "platform/CCGLViewProtocol.h"
|
||||
#include <agile.h>
|
||||
|
@ -37,7 +38,8 @@ THE SOFTWARE.
|
|||
|
||||
#include <agile.h>
|
||||
#include <DirectXMath.h>
|
||||
|
||||
#include <mutex>
|
||||
#include <queue>
|
||||
|
||||
NS_CC_BEGIN
|
||||
|
||||
|
@ -110,6 +112,7 @@ public:
|
|||
void UpdateForWindowSizeChange();
|
||||
void OnRendering();
|
||||
void OnSuspending();
|
||||
void GLView::QueueEvent(std::shared_ptr<InputEvent>& event);
|
||||
|
||||
private:
|
||||
Windows::Foundation::EventRegistrationToken m_eventToken;
|
||||
|
@ -148,6 +151,9 @@ private:
|
|||
float m_fFrameZoomFactor;
|
||||
WinRTWindow^ m_winRTWindow;
|
||||
Windows::Foundation::Rect m_keyboardRect;
|
||||
|
||||
std::queue<std::shared_ptr<InputEvent>> mInputEvents;
|
||||
std::mutex mMutex;
|
||||
};
|
||||
|
||||
NS_CC_END
|
||||
|
|
Loading…
Reference in New Issue