From de9f8dc4414b4e0fcf08fe9d50273068bfc286ad Mon Sep 17 00:00:00 2001 From: moadib Date: Fri, 24 Feb 2012 08:40:35 +0400 Subject: [PATCH] Added window group id for qnx-version of CCEGLView --- cocos2dx/platform/qnx/CCEGLView_qnx.cpp | 12 ++++++++++++ cocos2dx/platform/qnx/CCEGLView_qnx.h | 2 ++ 2 files changed, 14 insertions(+) diff --git a/cocos2dx/platform/qnx/CCEGLView_qnx.cpp b/cocos2dx/platform/qnx/CCEGLView_qnx.cpp index 0e25020b96..1d3e012630 100644 --- a/cocos2dx/platform/qnx/CCEGLView_qnx.cpp +++ b/cocos2dx/platform/qnx/CCEGLView_qnx.cpp @@ -96,6 +96,8 @@ CCEGLView::CCEGLView() m_screenEvent = 0; m_screenWindow = 0; + strcpy(m_window_group_id, ""); + snprintf(m_window_group_id, sizeof(m_window_group_id), "%d", getpid()); bps_initialize(); navigator_request_events(0); @@ -571,6 +573,12 @@ bool CCEGLView::createNativeWindow(const EGLConfig &config) return false; } +err = screen_create_window_group(m_screenWindow, m_window_group_id); + if (err) + { + fprintf(stderr, "screen_create_window_group"); + return false; + } format = chooseFormat(m_eglDisplay, config); err = screen_set_window_property_iv(m_screenWindow, SCREEN_PROPERTY_FORMAT, &format); if (err) @@ -813,6 +821,10 @@ void CCEGLView::setEventHandler(EventHandler* pHandler) m_pEventHandler = pHandler; } +const char* CCEGLView::getWindowGroupId() const +{ + return m_window_group_id; +} void CCEGLView::setTouchDelegate(EGLTouchDelegate * pDelegate) { m_pDelegate = pDelegate; diff --git a/cocos2dx/platform/qnx/CCEGLView_qnx.h b/cocos2dx/platform/qnx/CCEGLView_qnx.h index 0edb55b01f..a5026a0065 100644 --- a/cocos2dx/platform/qnx/CCEGLView_qnx.h +++ b/cocos2dx/platform/qnx/CCEGLView_qnx.h @@ -65,6 +65,7 @@ public: EGLTouchDelegate* getDelegate(void); void setEventHandler(EventHandler* pHandler); + const char* getWindowGroupId() const; // keep compatible void release(); void setTouchDelegate(EGLTouchDelegate * pDelegate); @@ -127,6 +128,7 @@ private: screen_event_t m_screenEvent; screen_window_t m_screenWindow; screen_context_t m_screenContext; + char m_window_group_id[16]; }; } // end of namespace cocos2d