2010-07-28 10:26:06 +08:00
|
|
|
/****************************************************************************
|
|
|
|
Copyright (c) 2010 cocos2d-x.org
|
|
|
|
|
|
|
|
http://www.cocos2d-x.org
|
|
|
|
|
|
|
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
|
|
of this software and associated documentation files (the "Software"), to deal
|
|
|
|
in the Software without restriction, including without limitation the rights
|
|
|
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
|
|
copies of the Software, and to permit persons to whom the Software is
|
|
|
|
furnished to do so, subject to the following conditions:
|
|
|
|
|
|
|
|
The above copyright notice and this permission notice shall be included in
|
|
|
|
all copies or substantial portions of the Software.
|
|
|
|
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
|
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
|
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
|
|
THE SOFTWARE.
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
#ifndef __CCX_EGLVIEW_UPHONE_H__
|
|
|
|
#define __CCX_EGLVIEW_UPHONE_H__
|
|
|
|
|
|
|
|
#include "GuiBase.h"
|
|
|
|
#include "TWindow.h"
|
|
|
|
|
2010-08-04 16:45:00 +08:00
|
|
|
#include "CGGeometry.h"
|
2010-07-28 10:26:06 +08:00
|
|
|
|
|
|
|
class TApplication;
|
|
|
|
|
|
|
|
namespace cocos2d {
|
2010-08-04 15:46:12 +08:00
|
|
|
class NSSet;
|
|
|
|
class CCTouch;
|
|
|
|
class EGLTouchDelegate;
|
2010-07-28 10:26:06 +08:00
|
|
|
|
2010-07-29 16:05:14 +08:00
|
|
|
class CCXEGL;
|
2010-07-28 18:18:27 +08:00
|
|
|
|
|
|
|
class CCX_DLL CCXEGLView : public TWindow
|
2010-07-28 10:26:06 +08:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
CCXEGLView(TApplication * pApp);
|
2010-08-03 11:23:12 +08:00
|
|
|
virtual ~CCXEGLView();
|
2010-07-28 10:26:06 +08:00
|
|
|
|
2010-08-03 11:23:12 +08:00
|
|
|
virtual Boolean AfterCreate(void);
|
2010-07-28 10:26:06 +08:00
|
|
|
virtual Boolean EventHandler(TApplication * pApp, EventType * pEvent);
|
2010-07-28 18:18:27 +08:00
|
|
|
|
2010-08-18 15:24:19 +08:00
|
|
|
CGRect getFrame();
|
2010-07-28 18:18:27 +08:00
|
|
|
CGSize getSize();
|
|
|
|
bool isOpenGLReady();
|
|
|
|
void release();
|
|
|
|
void setTouchDelegate(EGLTouchDelegate * pDelegate);
|
|
|
|
void swapBuffers();
|
2010-12-29 18:01:37 +08:00
|
|
|
bool canSetContentScaleFactor();
|
|
|
|
void setContentScaleFactor(float contentScaleFactor);
|
2010-07-28 18:18:27 +08:00
|
|
|
|
2010-12-09 18:28:16 +08:00
|
|
|
protected:
|
|
|
|
Boolean OnPenDown(EventType* pEvent, Int32 nIndex);
|
|
|
|
Boolean OnPenUp(EventType* pEvent, Int32 nIndex);
|
|
|
|
Boolean OnPenMove(EventType* pEvent);
|
2010-07-29 16:05:14 +08:00
|
|
|
|
2010-12-09 18:28:16 +08:00
|
|
|
private:
|
|
|
|
|
2010-12-02 18:44:13 +08:00
|
|
|
MESSAGE_t m_tMsg;
|
|
|
|
CCXEGL * m_pEGL;
|
2010-12-09 18:28:16 +08:00
|
|
|
EGLTouchDelegate * m_pDelegate;
|
2010-07-28 10:26:06 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
} // end of namespace cocos2d
|
|
|
|
|
|
|
|
#endif // end of __CCX_EGLVIEW_UPHONE_H__
|