cocos2d-x  2.2.3-gd2.113-rev1ec524e
Loading...
Searching...
No Matches
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:
[legend]
Collaboration diagram for CCDisplayLinkDirector:
[legend]

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 More...
 
virtual ~CCDirector (void)
 NA NA. More...
 
virtual bool init (void)
 
virtual long getClassTypeInfo ()
 NA NA. More...
 
CCScenegetRunningScene (void)
 Get current running Scene. More...
 
double getAnimationInterval (void)
 Get the FPS value. More...
 
virtual void setAnimationInterval (double dValue)=0
 Set the FPS value. More...
 
bool isDisplayStats (void)
 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...
 
float getSecondsPerFrame ()
 seconds per frame More...
 
CCEGLViewgetOpenGLView (void)
 Get the CCEGLView, where everything is rendered NA. More...
 
void setOpenGLView (CCEGLView *pobOpenGLView)
 
bool isNextDeltaTimeZero (void)
 
void setNextDeltaTimeZero (bool bNextDeltaTimeZero)
 
bool isPaused (void)
 Whether or not the Director is paused. More...
 
unsigned int getTotalFrames (void)
 How many frames were called since the director started. More...
 
ccDirectorProjection getProjection (void)
 Sets an OpenGL projection. More...
 
void setProjection (ccDirectorProjection kProjection)
 
void reshapeProjection (const CCSize &newWindowSize)
 reshape projection matrix when canvas has been change" More...
 
void 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...
 
void setNotificationNode (CCNode *node)
 
CCDirectorDelegategetDelegate () const
 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...
 
CCSize getVisibleSize ()
 returns visible size of the OpenGL view in points. More...
 
CCPoint 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...
 
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...
 
float getZEye (void)
 XXX: missing description. More...
 
void runWithScene (CCScene *pScene)
 Enters the Director's main loop with the given Scene. More...
 
void popScene (void)
 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...
 
void popToSceneStackLevel (int level)
 Pops out all scenes from the queue until it reaches level. More...
 
void end (void)
 Ends the execution, releases the running scene. More...
 
void pause (void)
 Pauses the running scene. More...
 
void resume (void)
 Resumes the paused scene The scheduled timers will be activated again. More...
 
virtual void stopAnimation (void)=0
 Stops the animation. More...
 
virtual void startAnimation (void)=0
 The main loop is triggered again. More...
 
void drawScene (void)
 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...
 
void setAlphaBlending (bool bOn)
 enables/disables OpenGL alpha blending More...
 
void setDepthTest (bool bOn)
 enables/disables OpenGL depth test More...
 
virtual void mainLoop (void)=0
 
void setContentScaleFactor (float scaleFactor)
 The size in pixels of the surface. More...
 
float getContentScaleFactor (void)
 
virtual CCSchedulergetScheduler (void)
 
virtual void setScheduler (CCScheduler *var)
 
virtual CCActionManagergetActionManager (void)
 
virtual void setActionManager (CCActionManager *var)
 
virtual CCTouchDispatchergetTouchDispatcher (void)
 
virtual void setTouchDispatcher (CCTouchDispatcher *var)
 
virtual CCKeypadDispatchergetKeypadDispatcher (void)
 
virtual void setKeypadDispatcher (CCKeypadDispatcher *var)
 
virtual CCAccelerometergetAccelerometer (void)
 
virtual void setAccelerometer (CCAccelerometer *var)
 
virtual float getDeltaTime (void)
 
bool pushScene (CCScene *pScene)
 Suspends the execution of the running scene, pushing it on the stack of suspended scenes. More...
 
bool replaceScene (CCScene *pScene)
 Replaces the running scene with a new one. More...
 
 CCDirector (const CCDirector &)
 
CCDirectoroperator= (const CCDirector &)
 
void checkSceneReference (void)
 
CCScenegetNextScene (void)
 
int levelForSceneInStack (CCScene *)
 
bool popSceneWithTransition (float, PopTransition)
 
void popToSceneInStack (CCScene *)
 
int sceneCount (void)
 
void willSwitchToScene (CCScene *)
 
void removeStatsLabel (void)
 
void resetSmoothFixCounter (void)
 
void setDeltaTime (float)
 
void setupScreenScale (CCSize, CCSize, TextureQuality)
 
void updateContentScale (TextureQuality)
 
void updateScreenScale (CCSize)
 
TextureQuality getLoadedTextureQuality (void) const
 
float getScreenScaleFactor (void)
 
float getScreenScaleFactorMax (void)
 
float getScreenScaleFactorW (void)
 
float getScreenScaleFactorH (void)
 
float getScreenTop (void)
 
float getScreenBottom (void)
 
float getScreenLeft (void)
 
float getScreenRight (void)
 
CCScenegetSceneReference (void)
 
void setSceneReference (CCScene *var)
 
virtual CCKeyboardDispatchergetKeyboardDispatcher (void)
 
virtual void setKeyboardDispatcher (CCKeyboardDispatcher *var)
 
virtual CCMouseDispatchergetMouseDispatcher (void)
 
virtual void setMouseDispatcher (CCMouseDispatcher *var)
 
float getActualDeltaTime (void)
 
void setActualDeltaTime (float var)
 
bool getIsTransitioning (void)
 
bool getSmoothFix (void)
 
void setSmoothFix (bool var)
 
bool getSmoothFixCheck (void)
 
void setSmoothFixCheck (bool var)
 
bool getForceSmoothFix (void)
 
void setForceSmoothFix (bool var)
 
int getSmoothFixCounter (void)
 
virtual CCSceneDelegate * getSceneDelegate (void)
 
virtual void setSceneDelegate (CCSceneDelegate *var)
 
bool getDontCallWillSwitch (void)
 
void setDontCallWillSwitch (bool var)
 
- Public Member Functions inherited from CCObject
 CCObject (void)
 
virtual ~CCObject (void)
 NA. More...
 
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)
 
 CCObject (const CCObject &)
 
CCObjectoperator= (const CCObject &)
 
virtual void encodeWithCoder (DS_Dictionary *)
 
virtual bool canEncode ()
 
CCObjectType getObjType () const
 
virtual int getTag () const
 
virtual void setTag (int nTag)
 
void setObjType (CCObjectType)
 
- Public Member Functions inherited from CCCopying
virtual CCObjectcopyWithZone (CCZone *pZone)
 
virtual long getClassTypeInfo ()=0
 

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...
 
CCTouchDispatcherm_pTouchDispatcher
 CCTouchDispatcher associated with this director. More...
 
CCKeypadDispatcherm_pKeypadDispatcher
 CCKeypadDispatcher associated with this director. More...
 
CCAccelerometerm_pAccelerometer
 CCAccelerometer associated with this director. More...
 
float m_fDeltaTime
 
bool m_bPurgeDirecotorInNextLoop
 
CCEGLViewm_pobOpenGLView
 
double m_dAnimationInterval
 
double m_dOldAnimationInterval
 
bool m_bLandscape
 
bool m_bDisplayStats
 
float m_fAccumDt
 
float m_fFrameRate
 
CCLabelAtlasm_pFPSLabel
 
CCLabelAtlasm_pSPFLabel
 
CCLabelAtlasm_pDrawsLabel
 
bool m_bPaused
 Whether or not the Director is paused. More...
 
unsigned int m_uTotalFrames
 
unsigned int m_uFrames
 
float m_fSecondsPerFrame
 
CCScenem_pRunningScene
 
CCScenem_pNextScene
 
bool m_bSendCleanupToScene
 
CCArraym_pobScenesStack
 
struct cc_timevalm_pLastUpdate
 
bool m_bNextDeltaTimeZero
 
ccDirectorProjection m_eProjection
 
CCSize m_obWinSizeInPoints
 
float m_fContentScaleFactor
 
char * m_pszFPS
 
CCNodem_pNotificationNode
 
CCDirectorDelegatem_pProjectionDelegate
 
char m_achPadding [0x4]
 
float m_fScreenScaleFactor
 
float m_fScreenScaleFactorMax
 
float m_fScreenScaleFactorW
 
float m_fScreenScaleFactorH
 
float m_fScreenTop
 
float m_fScreenBottom
 
float m_fScreenLeft
 
float m_fScreenRight
 
CCScenem_pSceneReference
 
CCKeyboardDispatcherm_pKeyboardDispatcher
 
CCMouseDispatcherm_pMouseDispatcher
 
float m_fActualDeltaTime
 
bool m_bIsTransitioning
 
bool m_bSmoothFix
 
bool m_bSmoothFixCheck
 
bool m_bForceSmoothFix
 
int m_nSmoothFixCounter
 
CCSceneDelegate * m_pAppDelegate
 
bool m_bDontCallWillSwitch
 
- Protected Attributes inherited from CCObject
unsigned int m_uReference
 
unsigned int m_uAutoReleaseCount
 
int m_nTag
 
int m_eObjType
 
unsigned int m_uObjectIdxInArray
 

Additional Inherited Members

- Static Public Member Functions inherited from CCDirector
static CCDirectorsharedDirector (void)
 returns a shared instance of the director getInstance More...
 
- Static Public Member Functions inherited from CCObject
static CCObjectcreateWithCoder (DS_Dictionary *)
 
- Public Attributes inherited from CCDirector
CCSize m_obScaleFactor
 
CCSize m_obResolutionInPixels
 
TextureQuality m_eTextureQuality
 
- Public Attributes inherited from CCObject
unsigned int m_uID
 
int m_nLuaID
 
- Protected Member Functions inherited from CCDirector
void purgeDirector ()
 
void setNextScene (void)
 
void showStats ()
 
void createStatsLabel ()
 
void calculateMPF ()
 
void getFPSImageData (unsigned char **datapointer, unsigned int *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 NA NA

Constructor & Destructor Documentation

◆ CCDisplayLinkDirector()

CCDisplayLinkDirector ( void  )
inline

Member Function Documentation

◆ mainLoop()

virtual void mainLoop ( void  )
virtual

Implements CCDirector.

◆ setAnimationInterval()

virtual void setAnimationInterval ( double  dValue)
virtual

Set the FPS value.

Implements CCDirector.

◆ startAnimation()

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.

◆ stopAnimation()

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

◆ m_bInvalid

bool m_bInvalid
protected

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