cocos2d-x  2.2.6
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
CCEGLViewProtocol Class Referenceabstract

#include <CCEGLViewProtocol.h>

Inheritance diagram for CCEGLViewProtocol:
CCEGLView CCEGLView CCEGLView CCEGLView CCEGLView CCEGLView CCEGLView CCEGLView CCEGLView CCEGLView CCEGLView CCEGLView

Public Member Functions

 CCEGLViewProtocol ()
virtual ~CCEGLViewProtocol ()
virtual void end ()=0
 Force destroying EGL view, subclass must implement this method. More...
 
virtual bool isOpenGLReady ()=0
 Get whether opengl render system is ready, subclass must implement this method. More...
 
virtual void swapBuffers ()=0
 Exchanges the front and back buffers, subclass must implement this method. More...
 
virtual void setIMEKeyboardState (bool bOpen)=0
 Open or close IME keyboard , subclass must implement this method. More...
 
virtual const CCSizegetFrameSize () const
 Get the frame size of EGL view. More...
 
local getFrameSize ()
 Get the frame size of EGL view. More...
 
virtual void setFrameSize (float width, float height)
 Set the frame size of EGL view. More...
 
virtual CCSize getVisibleSize () const
 Get the visible area size of opengl viewport. More...
 
virtual CCPoint getVisibleOrigin () const
 Get the visible origin point of opengl viewport. More...
 
local getVisibleOrigin ()
 Get the visible origin point of opengl viewport. More...
 
virtual void setDesignResolutionSize (float width, float height, ResolutionPolicy resolutionPolicy)
 Set the design resolution size. More...
 
local setDesignResolutionSize ( local width, local height, local resolutionPolicy)
 Set the design resolution size. More...
 
virtual const CCSizegetDesignResolutionSize () const
 Get design resolution size. More...
 
virtual void setTouchDelegate (EGLTouchDelegate *pDelegate)
 Set touch delegate. More...
 
local setTouchDelegate ( local pDelegate)
 Set touch delegate. More...
 
virtual void setViewPortInPoints (float x, float y, float w, float h)
 Set opengl view port rectangle with points. More...
 
virtual void setScissorInPoints (float x, float y, float w, float h)
 Set Scissor rectangle with points. More...
 
local setScissorInPoints ( local x, local y, local w, local h)
 Set Scissor rectangle with points. More...
 
virtual bool isScissorEnabled ()
 Get whether GL_SCISSOR_TEST is enable. More...
 
virtual CCRect getScissorRect ()
 Get the current scissor rectangle. More...
 
virtual void setViewName (const char *pszViewName)
const char * getViewName ()
virtual void handleTouchesBegin (int num, int ids[], float xs[], float ys[])
 Touch events are handled by default; if you want to customize your handlers, please override these functions: More...
 
virtual void handleTouchesMove (int num, int ids[], float xs[], float ys[])
virtual void handleTouchesEnd (int num, int ids[], float xs[], float ys[])
virtual void handleTouchesCancel (int num, int ids[], float xs[], float ys[])
const CCRectgetViewPortRect () const
 Get the opengl view port rectangle. More...
 
float getScaleX () const
 Get scale factor of the horizontal direction. More...
 
local getScaleX ()
 Get scale factor of the horizontal direction. More...
 
float getScaleY () const
 Get scale factor of the vertical direction. More...
 
local getScaleY ()
 Get scale factor of the vertical direction. More...
 

Protected Attributes

EGLTouchDelegatem_pDelegate
CCSize m_obScreenSize
local m_obScreenSize
CCSize m_obDesignResolutionSize
local m_obDesignResolutionSize
CCRect m_obViewPortRect
local m_obViewPortRect
char m_szViewName [50]
local m_szViewName ()
float m_fScaleX
local m_fScaleX
float m_fScaleY
local m_fScaleY
ResolutionPolicy m_eResolutionPolicy

Constructor & Destructor Documentation

virtual ~CCEGLViewProtocol ( )
virtual

Member Function Documentation

virtual void end ( )
pure virtual

Force destroying EGL view, subclass must implement this method.

Implemented in CCEGLView, CCEGLView, CCEGLView, CCEGLView, CCEGLView, CCEGLView, CCEGLView, CCEGLView, CCEGLView, CCEGLView, CCEGLView, and CCEGLView.

virtual const CCSize&
getDesignResolutionSize
( ) const
virtual

Get design resolution size.

Default resolution size is the same as 'getFrameSize'.

local getDesignResolutionSize ( )
virtual

Get design resolution size.

Default resolution size is the same as 'getFrameSize'.

virtual const CCSize& getFrameSize ( ) const
virtual

Get the frame size of EGL view.

In general, it returns the screen size since the EGL view is a fullscreen view.

local getFrameSize ( )
virtual

Get the frame size of EGL view.

In general, it returns the screen size since the EGL view is a fullscreen view.

float getScaleX ( ) const

Get scale factor of the horizontal direction.

local getScaleX ( )

Get scale factor of the horizontal direction.

float getScaleY ( ) const

Get scale factor of the vertical direction.

local getScaleY ( )

Get scale factor of the vertical direction.

virtual CCRect getScissorRect ( )
virtual

Get the current scissor rectangle.

const char* getViewName ( )
const CCRect& getViewPortRect ( ) const

Get the opengl view port rectangle.

local getViewPortRect ( )

Get the opengl view port rectangle.

virtual CCPoint getVisibleOrigin ( ) const
virtual

Get the visible origin point of opengl viewport.

local getVisibleOrigin ( )
virtual

Get the visible origin point of opengl viewport.

virtual CCSize getVisibleSize ( ) const
virtual

Get the visible area size of opengl viewport.

local getVisibleSize ( )
virtual

Get the visible area size of opengl viewport.

virtual void handleTouchesBegin ( int  num,
int  ids[],
float  xs[],
float  ys[] 
)
virtual

Touch events are handled by default; if you want to customize your handlers, please override these functions:

virtual void handleTouchesCancel ( int  num,
int  ids[],
float  xs[],
float  ys[] 
)
virtual
virtual void handleTouchesEnd ( int  num,
int  ids[],
float  xs[],
float  ys[] 
)
virtual
virtual void handleTouchesMove ( int  num,
int  ids[],
float  xs[],
float  ys[] 
)
virtual
virtual bool isOpenGLReady ( )
pure virtual

Get whether opengl render system is ready, subclass must implement this method.

Implemented in CCEGLView, CCEGLView, CCEGLView, CCEGLView, CCEGLView, CCEGLView, CCEGLView, CCEGLView, CCEGLView, CCEGLView, CCEGLView, and CCEGLView.

virtual bool isScissorEnabled ( )
virtual

Get whether GL_SCISSOR_TEST is enable.

virtual void
setDesignResolutionSize
( float  width,
float  height,
ResolutionPolicy  resolutionPolicy 
)
virtual

Set the design resolution size.

Parameters
widthDesign resolution width.
heightDesign resolution height.
resolutionPolicyThe resolution policy desired, you may choose: [1] kResolutionExactFit Fill screen by stretch-to-fit: if the design resolution ratio of width to height is different from the screen resolution ratio, your game view will be stretched. [2] kResolutionNoBorder Full screen without black border: if the design resolution ratio of width to height is different from the screen resolution ratio, two areas of your game view will be cut. [3] kResolutionShowAll Full screen with black border: if the design resolution ratio of width to height is different from the screen resolution ratio, two black borders will be shown.
local setDesignResolutionSize ( local  width,
local  height,
local  resolutionPolicy 
)
virtual

Set the design resolution size.

Parameters
widthDesign resolution width.
heightDesign resolution height.
resolutionPolicyThe resolution policy desired, you may choose: [1] kResolutionExactFit Fill screen by stretch-to-fit: if the design resolution ratio of width to height is different from the screen resolution ratio, your game view will be stretched. [2] kResolutionNoBorder Full screen without black border: if the design resolution ratio of width to height is different from the screen resolution ratio, two areas of your game view will be cut. [3] kResolutionShowAll Full screen with black border: if the design resolution ratio of width to height is different from the screen resolution ratio, two black borders will be shown.
virtual void setFrameSize ( float  width,
float  height 
)
virtual

Set the frame size of EGL view.

Reimplemented in CCEGLView, CCEGLView, CCEGLView, and CCEGLView.

local setFrameSize ( local  width,
local  height 
)
virtual

Set the frame size of EGL view.

Reimplemented in CCEGLView, CCEGLView, CCEGLView, and CCEGLView.

virtual void setIMEKeyboardState ( bool  bOpen)
pure virtual

Open or close IME keyboard , subclass must implement this method.

Implemented in CCEGLView, CCEGLView, CCEGLView, CCEGLView, CCEGLView, CCEGLView, CCEGLView, CCEGLView, CCEGLView, CCEGLView, CCEGLView, and CCEGLView.

virtual void setScissorInPoints ( float  x,
float  y,
float  w,
float  h 
)
virtual

Set Scissor rectangle with points.

Reimplemented in CCEGLView, CCEGLView, CCEGLView, CCEGLView, and CCEGLView.

local setScissorInPoints ( local  x,
local  y,
local  w,
local  h 
)
virtual

Set Scissor rectangle with points.

Reimplemented in CCEGLView, CCEGLView, CCEGLView, CCEGLView, and CCEGLView.

virtual void setTouchDelegate ( EGLTouchDelegate pDelegate)
virtual

Set touch delegate.

local setTouchDelegate ( local  pDelegate)
virtual

Set touch delegate.

virtual void setViewName ( const char *  pszViewName)
virtual
virtual void setViewPortInPoints ( float  x,
float  y,
float  w,
float  h 
)
virtual

Set opengl view port rectangle with points.

Reimplemented in CCEGLView, CCEGLView, CCEGLView, CCEGLView, and CCEGLView.

local setViewPortInPoints ( local  x,
local  y,
local  w,
local  h 
)
virtual

Set opengl view port rectangle with points.

Reimplemented in CCEGLView, CCEGLView, CCEGLView, CCEGLView, and CCEGLView.

virtual void swapBuffers ( )
pure virtual

Exchanges the front and back buffers, subclass must implement this method.

Implemented in CCEGLView, CCEGLView, CCEGLView, CCEGLView, CCEGLView, CCEGLView, CCEGLView, CCEGLView, CCEGLView, CCEGLView, CCEGLView, and CCEGLView.

Member Data Documentation

ResolutionPolicy
m_eResolutionPolicy
protected
local m_eResolutionPolicy
protected
float m_fScaleX
protected
local m_fScaleX
protected
float m_fScaleY
protected
local m_fScaleY
protected
CCSize m_obDesignResolutionSize
protected
local m_obDesignResolutionSize
protected
CCSize m_obScreenSize
protected
local m_obScreenSize
protected
CCRect m_obViewPortRect
protected
local m_obViewPortRect
protected
EGLTouchDelegate* m_pDelegate
protected
char m_szViewName[50]
protected
char m_szViewName[50]
protected

The documentation for this class was generated from the following file: