cocos2d-x  3.0alpha1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
EGLViewProtocol Class Referenceabstract

#include <CCEGLViewProtocol.h>

Inheritance diagram for EGLViewProtocol:
EGLView EGLView EGLView EGLView EGLView

Public Member Functions

 EGLViewProtocol ()
virtual ~EGLViewProtocol ()
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...
 
local isOpenGLReady ()
 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...
 
var swapBuffers ()
 Exchanges the front and back buffers, subclass must implement this method. More...
 
local swapBuffers ()
 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...
 
local setIMEKeyboardState ( local bOpen)
 Open or close IME keyboard , subclass must implement this method. More...
 
virtual void pollInputEvents ()
 Polls input events. More...
 
virtual const SizegetFrameSize () const
 Get the frame size of EGL view. More...
 
virtual void setFrameSize (float width, float height)
 Set the frame size of EGL view. More...
 
local setFrameSize ( local width, local height)
 Set the frame size of EGL view. More...
 
virtual Size getVisibleSize () const
 Get the visible area size of opengl viewport. More...
 
virtual Point 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 SizegetDesignResolutionSize () 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...
 
local setViewPortInPoints ( local x, local y, local w, local 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 Rect getScissorRect ()
 Get the current scissor rectangle. More...
 
var getScissorRect ()
 Get the current scissor rectangle. More...
 
local getScissorRect ()
 Get the current scissor rectangle. More...
 
virtual void setViewName (const char *pszViewName)
local setViewName ( local pszViewName)
const char * getViewName ()
var getViewName ()
local getViewName ()
virtual void handleTouchesBegin (int num, long 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, long ids[], float xs[], float ys[])
local handleTouchesMove ( local num)
virtual void handleTouchesEnd (int num, long ids[], float xs[], float ys[])
local handleTouchesEnd ( local num)
virtual void handleTouchesCancel (int num, long ids[], float xs[], float ys[])
local handleTouchesCancel ( local num)
const RectgetViewPortRect () const
 Get the opengl view port rectangle. More...
 
float getScaleX () const
 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

EGLTouchDelegate * _delegate
Size _screenSize
var _screenSize
local _screenSize
Size _designResolutionSize
var _designResolutionSize
local _designResolutionSize
Rect _viewPortRect
char _viewName [50]
var _viewName ()
local _viewName ()
float _scaleX
float _scaleY
ResolutionPolicy _resolutionPolicy
var _resolutionPolicy
local _resolutionPolicy

Constructor & Destructor Documentation

var ctor ( )
local EGLViewProtocol ( )
virtual ~EGLViewProtocol ( )
virtual

Member Function Documentation

virtual void end ( )
pure virtual

Force destroying EGL view, subclass must implement this method.

Implemented in EGLView, EGLView, EGLView, EGLView, and EGLView.

var end ( )
pure virtual

Force destroying EGL view, subclass must implement this method.

Implemented in EGLView, EGLView, EGLView, EGLView, and EGLView.

local end ( )
pure virtual

Force destroying EGL view, subclass must implement this method.

Implemented in EGLView, EGLView, EGLView, EGLView, and EGLView.

virtual const Size&
getDesignResolutionSize
( ) const
virtual

Get design resolution size.

Default resolution size is the same as 'getFrameSize'.

var getDesignResolutionSize ( )
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 Size& 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.

var getFrameSize ( )
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.

var getScaleX ( )

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.

var getScaleY ( )

Get scale factor of the vertical direction.

local getScaleY ( )

Get scale factor of the vertical direction.

virtual Rect getScissorRect ( )
virtual

Get the current scissor rectangle.

var getScissorRect ( )
virtual

Get the current scissor rectangle.

local getScissorRect ( )
virtual

Get the current scissor rectangle.

const char* getViewName ( )
var getViewName ( )
local getViewName ( )
const Rect& getViewPortRect ( ) const

Get the opengl view port rectangle.

var getViewPortRect ( )

Get the opengl view port rectangle.

local getViewPortRect ( )

Get the opengl view port rectangle.

virtual Point getVisibleOrigin ( ) const
virtual

Get the visible origin point of opengl viewport.

var getVisibleOrigin ( )
virtual

Get the visible origin point of opengl viewport.

local getVisibleOrigin ( )
virtual

Get the visible origin point of opengl viewport.

virtual Size getVisibleSize ( ) const
virtual

Get the visible area size of opengl viewport.

var getVisibleSize ( )
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,
long  ids[],
float  xs[],
float  ys[] 
)
virtual

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

var handleTouchesBegin ( var  num,
var  ids[],
var  xs[],
var  ys[] 
)
virtual

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

local handleTouchesBegin ( local  num,
local  ids[],
local  xs[],
local  ys[] 
)
virtual

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

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

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

Implemented in EGLView, EGLView, EGLView, EGLView, and EGLView.

var isOpenGLReady ( )
pure virtual

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

Implemented in EGLView, EGLView, EGLView, EGLView, and EGLView.

local isOpenGLReady ( )
pure virtual

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

Implemented in EGLView, EGLView, EGLView, EGLView, and EGLView.

virtual bool isScissorEnabled ( )
virtual

Get whether GL_SCISSOR_TEST is enable.

var isScissorEnabled ( )
virtual

Get whether GL_SCISSOR_TEST is enable.

local isScissorEnabled ( )
virtual

Get whether GL_SCISSOR_TEST is enable.

virtual void pollInputEvents ( )
virtual

Polls input events.

Subclass must implement methods if platform does not provide event callbacks.

var pollInputEvents ( )
virtual

Polls input events.

Subclass must implement methods if platform does not provide event callbacks.

local pollInputEvents ( )
virtual

Polls input events.

Subclass must implement methods if platform does not provide event callbacks.

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] EXACT_FIT 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] NO_BORDER 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] SHOW_ALL 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.
var setDesignResolutionSize ( var  width,
var  height,
var  resolutionPolicy 
)
virtual

Set the design resolution size.

Parameters
widthDesign resolution width.
heightDesign resolution height.
resolutionPolicyThe resolution policy desired, you may choose: [1] EXACT_FIT 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] NO_BORDER 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] SHOW_ALL 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] EXACT_FIT 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] NO_BORDER 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] SHOW_ALL 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 EGLView, EGLView, and EGLView.

var setFrameSize ( var  width,
var  height 
)
virtual

Set the frame size of EGL view.

Reimplemented in EGLView, EGLView, and EGLView.

local setFrameSize ( local  width,
local  height 
)
virtual

Set the frame size of EGL view.

Reimplemented in EGLView, EGLView, and EGLView.

virtual void setIMEKeyboardState ( bool  bOpen)
pure virtual

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

Implemented in EGLView, EGLView, EGLView, EGLView, and EGLView.

var setIMEKeyboardState ( var  bOpen)
pure virtual

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

Implemented in EGLView, EGLView, EGLView, EGLView, and EGLView.

local setIMEKeyboardState ( local  bOpen)
pure virtual

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

Implemented in EGLView, EGLView, EGLView, EGLView, and EGLView.

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

Set Scissor rectangle with points.

Reimplemented in EGLView, EGLView, and EGLView.

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

Set Scissor rectangle with points.

Reimplemented in EGLView, EGLView, and EGLView.

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

Set Scissor rectangle with points.

Reimplemented in EGLView, EGLView, and EGLView.

virtual void setTouchDelegate ( EGLTouchDelegate *  pDelegate)
virtual

Set touch delegate.

var setTouchDelegate ( var  pDelegate)
virtual

Set touch delegate.

local setTouchDelegate ( local  pDelegate)
virtual

Set touch delegate.

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

Set opengl view port rectangle with points.

Reimplemented in EGLView, EGLView, and EGLView.

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

Set opengl view port rectangle with points.

Reimplemented in EGLView, EGLView, and EGLView.

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

Set opengl view port rectangle with points.

Reimplemented in EGLView, EGLView, and EGLView.

virtual void swapBuffers ( )
pure virtual

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

Implemented in EGLView, EGLView, EGLView, EGLView, and EGLView.

var swapBuffers ( )
pure virtual

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

Implemented in EGLView, EGLView, EGLView, EGLView, and EGLView.

local swapBuffers ( )
pure virtual

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

Implemented in EGLView, EGLView, EGLView, EGLView, and EGLView.

Member Data Documentation

EGLTouchDelegate* _delegate
protected
Size _designResolutionSize
protected
var _designResolutionSize
protected
local _designResolutionSize
protected
ResolutionPolicy _resolutionPolicy
protected
var _resolutionPolicy
protected
local _resolutionPolicy
protected
float _scaleX
protected
var _scaleX
protected
local _scaleX
protected
float _scaleY
protected
var _scaleY
protected
local _scaleY
protected
Size _screenSize
protected
var _screenSize
protected
local _screenSize
protected
char _viewName[50]
protected
char _viewName[50]
protected
char _viewName[50]
protected
Rect _viewPortRect
protected
var _viewPortRect
protected
local _viewPortRect
protected

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