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

DisplayLinkDirector is a Director that synchronizes timers with the refresh rate of the display. More...

#include <CCDirector.h>

Inheritance diagram for CCDisplayLinkDirector:
CCDirector CCObject TypeInfo CCCopying

Public Member Functions

 CCDisplayLinkDirector (void)
virtual void mainLoop (void)
virtual void setAnimationInterval (double dValue)
 Set the FPS value. More...
 
virtual void startAnimation (void)
 The main loop is triggered again. More...
 
virtual void stopAnimation ()
 Stops the animation. More...
 
- Public Member Functions inherited from CCDirector
 CCDirector (void)
 ctor ()
virtual ~CCDirector (void)
virtual bool init (void)
var init ()
local init ()
virtual long getClassTypeInfo ()
CCScenegetRunningScene (void)
 Get current running Scene. More...
 
var getRunningScene ()
 Get current running Scene. More...
 
local getRunningScene ()
 Get current running Scene. More...
 
double getAnimationInterval (void)
 Get the FPS value. More...
 
local getAnimationInterval ()
 Get the FPS value. More...
 
bool isDisplayStats (void)
 Whether or not to display the FPS on the bottom-left corner. More...
 
var isDisplayStats ()
 Whether or not to display the FPS on the bottom-left corner. More...
 
local isDisplayStats ()
 Whether or not to display the FPS on the bottom-left corner. More...
 
void setDisplayStats (bool bDisplayStats)
 Display the FPS on the bottom-left corner. More...
 
var setDisplayStats ( var bDisplayStats)
 Display the FPS on the bottom-left corner. More...
 
local setDisplayStats ( local bDisplayStats)
 Display the FPS on the bottom-left corner. More...
 
float getSecondsPerFrame ()
 seconds per frame More...
 
var getSecondsPerFrame ()
 seconds per frame More...
 
local getSecondsPerFrame ()
 seconds per frame More...
 
CCEGLViewgetOpenGLView (void)
 Get the CCEGLView, where everything is rendered. More...
 
local getOpenGLView ()
 Get the CCEGLView, where everything is rendered. More...
 
void setOpenGLView (CCEGLView *pobOpenGLView)
var setOpenGLView ( var pobOpenGLView)
local setOpenGLView ( local pobOpenGLView)
bool isNextDeltaTimeZero (void)
var isNextDeltaTimeZero ()
local isNextDeltaTimeZero ()
void setNextDeltaTimeZero (bool bNextDeltaTimeZero)
var setNextDeltaTimeZero ( var bNextDeltaTimeZero)
local setNextDeltaTimeZero ( local bNextDeltaTimeZero)
bool isPaused (void)
 Whether or not the Director is paused. More...
 
var isPaused ()
 Whether or not the Director is paused. More...
 
local isPaused ()
 Whether or not the Director is paused. More...
 
unsigned int getTotalFrames (void)
 How many frames were called since the director started. More...
 
local getTotalFrames ()
 How many frames were called since the director started. More...
 
ccDirectorProjection getProjection (void)
 Sets an OpenGL projection. More...
 
local getProjection ()
 Sets an OpenGL projection. More...
 
void setProjection (ccDirectorProjection kProjection)
var setProjection ( var kProjection)
local setProjection ( local kProjection)
void reshapeProjection (const CCSize &newWindowSize)
 reshape projection matrix when canvas has been change" More...
 
var reshapeProjection ( var newWindowSize)
 reshape projection matrix when canvas has been change" More...
 
local reshapeProjection ( local newWindowSize)
 reshape projection matrix when canvas has been change" More...
 
void setViewport ()
 Sets the glViewport. More...
 
var setViewport ()
 Sets the glViewport. More...
 
local setViewport ()
 Sets the glViewport. More...
 
bool isSendCleanupToScene (void)
 How many frames were called since the director started. More...
 
CCNodegetNotificationNode ()
 This object will be visited after the main scene is visited. More...
 
var getNotificationNode ()
 This object will be visited after the main scene is visited. More...
 
local getNotificationNode ()
 This object will be visited after the main scene is visited. More...
 
void setNotificationNode (CCNode *node)
CCDirectorDelegategetDelegate () const
 CCDirector delegate. More...
 
var getDelegate ()
 CCDirector delegate. More...
 
local getDelegate ()
 CCDirector delegate. More...
 
void setDelegate (CCDirectorDelegate *pDelegate)
CCSize getWinSize (void)
 returns the size of the OpenGL view in points. More...
 
CCSize getWinSizeInPixels (void)
 returns the size of the OpenGL view in pixels. More...
 
local getWinSizeInPixels ()
 returns the size of the OpenGL view in pixels. More...
 
CCSize getVisibleSize ()
 returns visible size of the OpenGL view in points. More...
 
CCPoint getVisibleOrigin ()
 returns visible origin of the OpenGL view in points. More...
 
local getVisibleOrigin ()
 returns visible origin of the OpenGL view in points. More...
 
CCPoint convertToGL (const CCPoint &obPoint)
 converts a UIKit coordinate to an OpenGL coordinate Useful to convert (multi) touch coordinates to the current layout (portrait or landscape) More...
 
var convertToGL ( var obPoint)
 converts a UIKit coordinate to an OpenGL coordinate Useful to convert (multi) touch coordinates to the current layout (portrait or landscape) More...
 
local convertToGL ( local obPoint)
 converts a UIKit coordinate to an OpenGL coordinate Useful to convert (multi) touch coordinates to the current layout (portrait or landscape) More...
 
CCPoint convertToUI (const CCPoint &obPoint)
 converts an OpenGL coordinate to a UIKit coordinate Useful to convert node points to window points for calls such as glScissor More...
 
local convertToUI ( local obPoint)
 converts an OpenGL coordinate to a UIKit coordinate Useful to convert node points to window points for calls such as glScissor More...
 
float getZEye (void)
 XXX: missing description. More...
 
var getZEye ()
 XXX: missing description. More...
 
local getZEye ()
 XXX: missing description. More...
 
void runWithScene (CCScene *pScene)
 Enters the Director's main loop with the given Scene. More...
 
local runWithScene ( local pScene)
 Enters the Director's main loop with the given Scene. More...
 
void pushScene (CCScene *pScene)
 Suspends the execution of the running scene, pushing it on the stack of suspended scenes. More...
 
void popScene (void)
 Pops out a scene from the queue. More...
 
var popScene ()
 Pops out a scene from the queue. More...
 
local popScene ()
 Pops out a scene from the queue. More...
 
void popToRootScene (void)
 Pops out all scenes from the queue until the root scene in the queue. More...
 
var popToRootScene ()
 Pops out all scenes from the queue until the root scene in the queue. More...
 
local popToRootScene ()
 Pops out all scenes from the queue until the root scene in the queue. More...
 
void popToSceneStackLevel (int level)
 Pops out all scenes from the queue until it reaches level. More...
 
void replaceScene (CCScene *pScene)
 Replaces the running scene with a new one. More...
 
void end (void)
 Ends the execution, releases the running scene. More...
 
void pause (void)
 Pauses the running scene. More...
 
var pause ()
 Pauses the running scene. More...
 
void resume (void)
 Resumes the paused scene The scheduled timers will be activated again. More...
 
void drawScene (void)
 Draw the scene. More...
 
local drawScene ()
 Draw the scene. More...
 
void purgeCachedData (void)
 Removes cached all cocos2d cached data. More...
 
void setDefaultValues (void)
 sets the default values based on the CCConfiguration info More...
 
void setGLDefaultValues (void)
 sets the OpenGL default values More...
 
var setGLDefaultValues ()
 sets the OpenGL default values More...
 
local setGLDefaultValues ()
 sets the OpenGL default values More...
 
void setAlphaBlending (bool bOn)
 enables/disables OpenGL alpha blending More...
 
var setAlphaBlending ( var bOn)
 enables/disables OpenGL alpha blending More...
 
local setAlphaBlending ( local bOn)
 enables/disables OpenGL alpha blending More...
 
void setDepthTest (bool bOn)
 enables/disables OpenGL depth test More...
 
var setDepthTest ( var bOn)
 enables/disables OpenGL depth test More...
 
local setDepthTest ( local bOn)
 enables/disables OpenGL depth test More...
 
void setContentScaleFactor (float scaleFactor)
 The size in pixels of the surface. More...
 
float getContentScaleFactor (void)
virtual CCSchedulergetScheduler (void)
 getScheduler More...
 
var getScheduler ()
 getScheduler More...
 
local getScheduler ()
 getScheduler More...
 
virtual void setScheduler (CCScheduler *var)
 setScheduler More...
 
local setScheduler ( local var)
 setScheduler More...
 
virtual CCActionManagergetActionManager (void)
 getActionManager More...
 
var getActionManager ()
 getActionManager More...
 
local getActionManager ()
 getActionManager More...
 
virtual void setActionManager (CCActionManager *var)
 setActionManager More...
 
local setActionManager ( local var)
 setActionManager More...
 
virtual CCTouchDispatchergetTouchDispatcher (void)
 getTouchDispatcher More...
 
local getTouchDispatcher ()
 getTouchDispatcher More...
 
virtual void setTouchDispatcher (CCTouchDispatcher *var)
 setTouchDispatcher More...
 
local setTouchDispatcher ( local var)
 setTouchDispatcher More...
 
virtual CCKeypadDispatchergetKeypadDispatcher (void)
 getKeypadDispatcher More...
 
local getKeypadDispatcher ()
 getKeypadDispatcher More...
 
virtual void setKeypadDispatcher (CCKeypadDispatcher *var)
 setKeypadDispatcher More...
 
var setKeypadDispatcher ( var var)
 setKeypadDispatcher More...
 
local setKeypadDispatcher ( local var)
 setKeypadDispatcher More...
 
virtual CCAccelerometergetAccelerometer (void)
virtual void setAccelerometer (CCAccelerometer *var)
 setAccelerometer More...
 
local setAccelerometer ( local var)
 setAccelerometer More...
 
virtual float getDeltaTime (void)
 getDeltaTime More...
 
var getDeltaTime ()
 getDeltaTime More...
 
local getDeltaTime ()
 getDeltaTime More...
 
- Public Member Functions inherited from CCObject
 CCObject (void)
virtual ~CCObject (void)
void release (void)
void retain (void)
CCObjectautorelease (void)
CCObjectcopy (void)
bool isSingleReference (void) const
unsigned int retainCount (void) const
virtual bool isEqual (const CCObject *pObject)
virtual void acceptVisitor (CCDataVisitor &visitor)
virtual void update (float dt)
- Public Member Functions inherited from CCCopying
virtual CCObjectcopyWithZone (CCZone *pZone)

Protected Attributes

bool m_bInvalid
- Protected Attributes inherited from CCDirector
CCSchedulerm_pScheduler
 CCScheduler associated with this director. More...
 
CCActionManagerm_pActionManager
 CCActionManager associated with this director. More...
 
var m_pActionManager
 CCActionManager associated with this director. More...
 
local m_pActionManager
 CCActionManager associated with this director. More...
 
CCTouchDispatcherm_pTouchDispatcher
 CCTouchDispatcher associated with this director. More...
 
var m_pTouchDispatcher
 CCTouchDispatcher associated with this director. More...
 
local m_pTouchDispatcher
 CCTouchDispatcher associated with this director. More...
 
CCKeypadDispatcherm_pKeypadDispatcher
 CCKeypadDispatcher associated with this director. More...
 
var m_pKeypadDispatcher
 CCKeypadDispatcher associated with this director. More...
 
local m_pKeypadDispatcher
 CCKeypadDispatcher associated with this director. More...
 
CCAccelerometerm_pAccelerometer
 CCAccelerometer associated with this director. More...
 
var m_pAccelerometer
 CCAccelerometer associated with this director. More...
 
local m_pAccelerometer
 CCAccelerometer associated with this director. More...
 
float m_fDeltaTime
var m_fDeltaTime
local m_fDeltaTime
bool m_bPurgeDirecotorInNextLoop
CCEGLViewm_pobOpenGLView
double m_dAnimationInterval
var m_dAnimationInterval
local m_dAnimationInterval
double m_dOldAnimationInterval
var m_dOldAnimationInterval
local m_dOldAnimationInterval
bool m_bLandscape
var m_bLandscape
local m_bLandscape
bool m_bDisplayStats
var m_bDisplayStats
local m_bDisplayStats
float m_fAccumDt
var m_fAccumDt
local m_fAccumDt
float m_fFrameRate
var m_fFrameRate
local m_fFrameRate
CCLabelAtlasm_pFPSLabel
var m_pFPSLabel
local m_pFPSLabel
CCLabelAtlasm_pSPFLabel
var m_pSPFLabel
local m_pSPFLabel
CCLabelAtlasm_pDrawsLabel
var m_pDrawsLabel
local m_pDrawsLabel
bool m_bPaused
 Whether or not the Director is paused. More...
 
var m_bPaused
 Whether or not the Director is paused. More...
 
local m_bPaused
 Whether or not the Director is paused. More...
 
unsigned int m_uTotalFrames
var m_uTotalFrames
local m_uTotalFrames
unsigned int m_uFrames
var m_uFrames
local m_uFrames
float m_fSecondsPerFrame
var m_fSecondsPerFrame
local m_fSecondsPerFrame
CCScenem_pRunningScene
var m_pRunningScene
local m_pRunningScene
CCScenem_pNextScene
var m_pNextScene
local m_pNextScene
bool m_bSendCleanupToScene
var m_bSendCleanupToScene
local m_bSendCleanupToScene
CCArraym_pobScenesStack
var m_pobScenesStack
local m_pobScenesStack
struct cc_timevalm_pLastUpdate
var m_pLastUpdate
local m_pLastUpdate
bool m_bNextDeltaTimeZero
var m_bNextDeltaTimeZero
local m_bNextDeltaTimeZero
ccDirectorProjection m_eProjection
var m_eProjection
local m_eProjection
CCSize m_obWinSizeInPoints
var m_obWinSizeInPoints
local m_obWinSizeInPoints
float m_fContentScaleFactor
var m_fContentScaleFactor
local m_fContentScaleFactor
char * m_pszFPS
var m_pszFPS
local m_pszFPS
CCNodem_pNotificationNode
var m_pNotificationNode
local m_pNotificationNode
CCDirectorDelegatem_pProjectionDelegate
var m_pProjectionDelegate
local m_pProjectionDelegate
- Protected Attributes inherited from CCObject
unsigned int m_uReference
unsigned int m_uAutoReleaseCount

Additional Inherited Members

- Static Public Member Functions inherited from CCDirector
static CCDirectorsharedDirector (void)
 returns a shared instance of the director More...
 
- Public Attributes inherited from CCObject
unsigned int m_uID
int m_nLuaID
- Protected Member Functions inherited from CCDirector
void purgeDirector ()
void setNextScene (void)
local setNextScene ()
void showStats ()
var showStats ()
local showStats ()
void createStatsLabel ()
var createStatsLabel ()
local createStatsLabel ()
void calculateMPF ()
var calculateMPF ()
local calculateMPF ()
void getFPSImageData (unsigned char **datapointer, unsigned int *length)
var getFPSImageData ( var datapointer, var length)
local getFPSImageData ( local datapointer, local length)
void calculateDeltaTime ()
 calculates delta time since last time it was called More...
 

Detailed Description

DisplayLinkDirector is a Director that synchronizes timers with the refresh rate of the display.

Features and Limitations:

  • Scheduled timers & drawing are synchronizes with the refresh rate of the display
  • Only supports animation intervals of 1/60 1/30 & 1/15
Since
v0.8.2

Constructor & Destructor Documentation

CCDisplayLinkDirector ( void  )
inline

Member Function Documentation

virtual void mainLoop ( void  )
virtual

Implements CCDirector.

virtual void setAnimationInterval ( double  dValue)
virtual

Set the FPS value.

Implements CCDirector.

virtual void startAnimation ( void  )
virtual

The main loop is triggered again.

Call this function only if [stopAnimation] was called earlier

Warning
Don't call this function to start the main loop. To run the main loop call runWithScene

Implements CCDirector.

virtual void stopAnimation ( )
virtual

Stops the animation.

Nothing will be drawn. The main loop won't be triggered anymore. If you don't want to pause your animation call [pause] instead.

Implements CCDirector.

Member Data Documentation

bool m_bInvalid
protected

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