Added CCEGLView::EventHandler class for Blackberry platform

Added CCEGLView ::getWindowGroupId() method for Blackberry platform
This commit is contained in:
moadib 2013-01-30 18:28:06 +04:00
parent ba3b2b7aa6
commit 4d271e782b
2 changed files with 28 additions and 0 deletions

View File

@ -77,6 +77,7 @@ static CCTouch *s_pTouches[MAX_TOUCHES] = { NULL };
static CCEGLView* s_pInstance = NULL;
CCEGLView::CCEGLView()
: m_pEventHandler(NULL)
{
m_eglDisplay = EGL_NO_DISPLAY;
m_eglContext = EGL_NO_CONTEXT;
@ -103,7 +104,16 @@ CCEGLView::CCEGLView()
CCEGLView::~CCEGLView()
{
}
void CCEGLView::setEventHandler(EventHandler* pHandler)
{
m_pEventHandler = pHandler;
}
const char* CCEGLView::getWindowGroupId() const
{
return m_windowGroupID;
}
void CCEGLView::release()
@ -575,6 +585,9 @@ bool CCEGLView::handleEvents()
// break if no more events
if (event == NULL)
break;
if (m_pEventHandler && m_pEventHandler->HandleBPSEvent(event))
continue;
domain = bps_event_get_domain(event);

View File

@ -29,15 +29,28 @@ THE SOFTWARE.
#include "platform/CCEGLViewProtocol.h"
#include "platform/CCPlatformMacros.h"
#include <bps/event.h>
NS_CC_BEGIN
class CC_DLL CCEGLView : public CCEGLViewProtocol
{
public:
class CC_DLL EventHandler
{
public:
virtual bool HandleBPSEvent(bps_event_t* event) = 0;
virtual ~EventHandler() {}
};
public:
CCEGLView();
virtual ~CCEGLView();
bool isOpenGLReady();
void setEventHandler(EventHandler* pHandler);
const char* getWindowGroupId() const;
// keep compatible
void end();
@ -67,6 +80,8 @@ private:
bool m_isGLInitialized;
bool m_isWindowActive;
EventHandler* m_pEventHandler;
EGLDisplay m_eglDisplay;
EGLContext m_eglContext;