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.
|
|
|
|
****************************************************************************/
|
|
|
|
|
2011-03-09 17:28:35 +08:00
|
|
|
#ifndef __CC_EGLVIEW_WOPHONE_H__
|
|
|
|
#define __CC_EGLVIEW_WOPHONE_H__
|
2010-07-28 10:26:06 +08:00
|
|
|
|
|
|
|
#include "GuiBase.h"
|
|
|
|
#include "TWindow.h"
|
|
|
|
|
2011-03-07 18:20:48 +08:00
|
|
|
#include "CCGeometry.h"
|
2011-02-19 17:44:43 +08:00
|
|
|
#include "TG3.h"
|
2010-07-28 10:26:06 +08:00
|
|
|
|
|
|
|
class TApplication;
|
|
|
|
|
|
|
|
namespace cocos2d {
|
2011-03-07 18:20:48 +08:00
|
|
|
class CCSet;
|
2010-08-04 15:46:12 +08:00
|
|
|
class CCTouch;
|
|
|
|
class EGLTouchDelegate;
|
2010-07-28 10:26:06 +08:00
|
|
|
|
2011-03-07 18:20:48 +08:00
|
|
|
class CCEGL;
|
2010-07-28 18:18:27 +08:00
|
|
|
|
2011-03-07 18:20:48 +08:00
|
|
|
class CC_DLL CCEGLView : public TWindow
|
2010-07-28 10:26:06 +08:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
2011-03-07 18:20:48 +08:00
|
|
|
CCEGLView(TApplication * pApp);
|
|
|
|
virtual ~CCEGLView();
|
2010-07-28 10:26:06 +08:00
|
|
|
|
2011-02-19 17:44:43 +08:00
|
|
|
virtual Boolean Create(int nWidthInPoints, int nHeightInPoints);
|
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
|
|
|
|
2011-03-07 18:20:48 +08:00
|
|
|
CCRect getFrame();
|
|
|
|
CCSize getSize();
|
2010-07-28 18:18:27 +08:00
|
|
|
bool isOpenGLReady();
|
|
|
|
void release();
|
|
|
|
void setTouchDelegate(EGLTouchDelegate * pDelegate);
|
|
|
|
void swapBuffers();
|
2010-12-29 18:01:37 +08:00
|
|
|
bool canSetContentScaleFactor();
|
|
|
|
void setContentScaleFactor(float contentScaleFactor);
|
2011-01-10 15:13:30 +08:00
|
|
|
void setAnimationInterval(double interval) {};
|
2011-02-19 17:44:43 +08:00
|
|
|
void setViewPortInPoints(float x, float y, float w, float h);
|
2011-05-05 18:17:50 +08:00
|
|
|
void setIMEKeyboardState(bool bOpen);
|
2011-02-19 17:44:43 +08:00
|
|
|
// static function
|
|
|
|
/**
|
|
|
|
@brief get the shared main open gl window
|
|
|
|
*/
|
2011-03-07 18:20:48 +08:00
|
|
|
static CCEGLView& sharedOpenGLView();
|
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;
|
2011-03-07 18:20:48 +08:00
|
|
|
CCEGL * m_pEGL;
|
2010-12-09 18:28:16 +08:00
|
|
|
EGLTouchDelegate * m_pDelegate;
|
2011-02-19 17:44:43 +08:00
|
|
|
|
|
|
|
TSize m_tSizeInPoints;
|
|
|
|
float m_fScreenScaleFactor;
|
|
|
|
TRectangle m_rcViewPort;
|
2011-05-05 18:17:50 +08:00
|
|
|
TEdit * m_pTextField;
|
|
|
|
int m_nTextLen;
|
2010-07-28 10:26:06 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
} // end of namespace cocos2d
|
|
|
|
|
2011-03-09 17:28:35 +08:00
|
|
|
#endif // end of __CC_EGLVIEW_WOPHONE_H__
|