Cocos2d-x  v3.10
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Groups
DisplayLinkDirector Class Reference

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

Inherits Director.

Public Member Functions

virtual void setAnimationInterval (float value) override
 Sets the FPS value. More...
 
local setAnimationInterval ( local value)
 Sets the FPS value. More...
 
virtual void startAnimation () override
 The main loop is triggered again. More...
 
var startAnimation ()
 The main loop is triggered again. More...
 
local startAnimation ()
 The main loop is triggered again. More...
 
virtual void stopAnimation () override
 Stops the animation. More...
 
local stopAnimation ()
 Stops the animation. More...
 
- Public Member Functions inherited from Director
ScenegetRunningScene ()
 Gets current running Scene. More...
 
var getRunningScene ()
 Gets current running Scene. More...
 
local getRunningScene ()
 Gets current running Scene. More...
 
float getAnimationInterval ()
 Gets the FPS value.
 
var getAnimationInterval ()
 Gets the FPS value.
 
local getAnimationInterval ()
 Gets the FPS value.
 
bool isDisplayStats ()
 Whether or not to display the FPS on the bottom-left corner.
 
var isDisplayStats ()
 Whether or not to display the FPS on the bottom-left corner.
 
local isDisplayStats ()
 Whether or not to display the FPS on the bottom-left corner.
 
void setDisplayStats (bool displayStats)
 Display the FPS on the bottom-left corner.
 
var setDisplayStats ( var displayStats)
 Display the FPS on the bottom-left corner.
 
local setDisplayStats ( local displayStats)
 Display the FPS on the bottom-left corner.
 
float getSecondsPerFrame ()
 Get seconds per frame.
 
var getSecondsPerFrame ()
 Get seconds per frame.
 
local getSecondsPerFrame ()
 Get seconds per frame.
 
GLViewgetOpenGLView ()
 Get the GLView.
 
var getOpenGLView ()
 Get the GLView.
 
void setOpenGLView (GLView *openGLView)
 Sets the GLView.
 
var setOpenGLView ( var openGLView)
 Sets the GLView.
 
bool isNextDeltaTimeZero ()
 Whether or not _nextDeltaTimeZero is set to 0.
 
var isNextDeltaTimeZero ()
 Whether or not _nextDeltaTimeZero is set to 0.
 
local isNextDeltaTimeZero ()
 Whether or not _nextDeltaTimeZero is set to 0.
 
void setNextDeltaTimeZero (bool nextDeltaTimeZero)
 Sets the delta time between current frame and next frame is 0. More...
 
bool isPaused ()
 Whether or not the Director is paused.
 
unsigned int getTotalFrames ()
 How many frames were called since the director started.
 
var getTotalFrames ()
 How many frames were called since the director started.
 
local getTotalFrames ()
 How many frames were called since the director started.
 
Projection getProjection ()
 Gets an OpenGL projection.
 
var getProjection ()
 Gets an OpenGL projection.
 
void setProjection (Projection projection)
 Sets OpenGL projection.
 
var setProjection ( var projection)
 Sets OpenGL projection.
 
local setProjection ( local projection)
 Sets OpenGL projection.
 
void setViewport ()
 Sets the glViewport.
 
bool isSendCleanupToScene ()
 Whether or not the replaced scene will receive the cleanup message. More...
 
NodegetNotificationNode () const
 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 (Node *node)
 Sets the notification node.
 
var setNotificationNode ( var node)
 Sets the notification node.
 
local setNotificationNode ( local node)
 Sets the notification node.
 
const SizegetWinSize () const
 Returns the size of the OpenGL view in points.
 
var getWinSize ()
 Returns the size of the OpenGL view in points.
 
local getWinSize ()
 Returns the size of the OpenGL view in points.
 
Size getWinSizeInPixels () const
 Returns the size of the OpenGL view in pixels.
 
var getWinSizeInPixels ()
 Returns the size of the OpenGL view in pixels.
 
local getWinSizeInPixels ()
 Returns the size of the OpenGL view in pixels.
 
Size getVisibleSize () const
 Returns visible size of the OpenGL view in points. More...
 
var getVisibleSize ()
 Returns visible size of the OpenGL view in points. More...
 
local getVisibleSize ()
 Returns visible size of the OpenGL view in points. More...
 
Vec2 getVisibleOrigin () const
 Returns visible origin coordinate of the OpenGL view in points.
 
Vec2 convertToGL (const Vec2 &point)
 Converts a screen coordinate to an OpenGL coordinate. More...
 
var convertToGL ( var point)
 Converts a screen coordinate to an OpenGL coordinate. More...
 
local convertToGL ( local point)
 Converts a screen coordinate to an OpenGL coordinate. More...
 
Vec2 convertToUI (const Vec2 &point)
 Converts an OpenGL coordinate to a screen coordinate. More...
 
float getZEye () const
 Gets the distance between camera and near clipping frame. More...
 
void runWithScene (Scene *scene)
 Enters the Director's main loop with the given Scene. More...
 
local runWithScene ( local scene)
 Enters the Director's main loop with the given Scene. More...
 
void pushScene (Scene *scene)
 Suspends the execution of the running scene, pushing it on the stack of suspended scenes. More...
 
void popScene ()
 Pops out a scene from the stack. More...
 
void popToRootScene ()
 Pops out all scenes from the stack until the root scene in the queue. More...
 
void popToSceneStackLevel (int level)
 Pops out all scenes from the stack until it reaches level. More...
 
var popToSceneStackLevel ( var level)
 Pops out all scenes from the stack until it reaches level. More...
 
local popToSceneStackLevel ( local level)
 Pops out all scenes from the stack until it reaches level. More...
 
void replaceScene (Scene *scene)
 Replaces the running scene with a new one. More...
 
void end ()
 Ends the execution, releases the running scene.
 
void pause ()
 Pauses the running scene. More...
 
var pause ()
 Pauses the running scene. More...
 
local pause ()
 Pauses the running scene. More...
 
void resume ()
 Resumes the paused scene. More...
 
void drawScene ()
 Draw the scene. More...
 
var drawScene ()
 Draw the scene. More...
 
local drawScene ()
 Draw the scene. More...
 
void purgeCachedData ()
 Removes all cocos2d cached data. More...
 
void setDefaultValues ()
 Sets the default values based on the Configuration info.
 
var setDefaultValues ()
 Sets the default values based on the Configuration info.
 
local setDefaultValues ()
 Sets the default values based on the Configuration info.
 
void setGLDefaultValues ()
 Sets the OpenGL default values. More...
 
local setGLDefaultValues ()
 Sets the OpenGL default values. More...
 
void setAlphaBlending (bool on)
 Enables/disable alpha blending.
 
var setAlphaBlending ( var on)
 Enables/disable alpha blending.
 
local setAlphaBlending ( local on)
 Enables/disable alpha blending.
 
void setClearColor (const Color4F &clearColor)
 Sets clear values for the color buffers, value range of each element is [0.0, 1.0].
 
void setDepthTest (bool on)
 Enable/disable depth test.
 
void setContentScaleFactor (float scaleFactor)
 The size in pixels of the surface. More...
 
var setContentScaleFactor ( var scaleFactor)
 The size in pixels of the surface. More...
 
local setContentScaleFactor ( local scaleFactor)
 The size in pixels of the surface. More...
 
float getContentScaleFactor () const
 Gets content scale factor.
 
SchedulergetScheduler () const
 Gets the Scheduler associated with this director.
 
var getScheduler ()
 Gets the Scheduler associated with this director.
 
local getScheduler ()
 Gets the Scheduler associated with this director.
 
void setScheduler (Scheduler *scheduler)
 Sets the Scheduler associated with this director.
 
ActionManagergetActionManager () const
 Gets the ActionManager associated with this director.
 
var getActionManager ()
 Gets the ActionManager associated with this director.
 
local getActionManager ()
 Gets the ActionManager associated with this director.
 
void setActionManager (ActionManager *actionManager)
 Sets the ActionManager associated with this director.
 
var setActionManager ( var actionManager)
 Sets the ActionManager associated with this director.
 
local setActionManager ( local actionManager)
 Sets the ActionManager associated with this director.
 
EventDispatchergetEventDispatcher () const
 Gets the EventDispatcher associated with this director.
 
local getEventDispatcher ()
 Gets the EventDispatcher associated with this director.
 
void setEventDispatcher (EventDispatcher *dispatcher)
 Sets the EventDispatcher associated with this director.
 
local setEventDispatcher ( local dispatcher)
 Sets the EventDispatcher associated with this director.
 
Renderer * getRenderer () const
 Returns the Renderer associated with this director.
 
var getRenderer ()
 Returns the Renderer associated with this director.
 
local getRenderer ()
 Returns the Renderer associated with this director.
 
Console * getConsole () const
 Returns the Console associated with this director.
 
local getConsole ()
 Returns the Console associated with this director.
 
float getFrameRate () const
 Gets Frame Rate.
 
local getFrameRate ()
 Gets Frame Rate.
 
void pushMatrix (MATRIX_STACK_TYPE type)
 Clones a specified type matrix and put it to the top of specified type of matrix stack.
 
local pushMatrix ( local type)
 Clones a specified type matrix and put it to the top of specified type of matrix stack.
 
void popMatrix (MATRIX_STACK_TYPE type)
 Pops the top matrix of the specified type of matrix stack.
 
void loadIdentityMatrix (MATRIX_STACK_TYPE type)
 Adds an identity matrix to the top of specified type of matrxi stack.
 
void loadMatrix (MATRIX_STACK_TYPE type, const Mat4 &mat)
 Adds a matrix to the top of specified type of matrix stack. More...
 
local loadMatrix ( local type, local mat)
 Adds a matrix to the top of specified type of matrix stack. More...
 
void multiplyMatrix (MATRIX_STACK_TYPE type, const Mat4 &mat)
 Multiplies a matrix to the top of specified type of matrix stack. More...
 
const Mat4getMatrix (MATRIX_STACK_TYPE type)
 Gets the top matrix of specified type of matrix stack.
 
void resetMatrixStack ()
 Clears all types of matrix stack, and add indentity matrix to these matrix stacks.
 
const std::thread::id & getCocos2dThreadId () const
 returns the cocos2d thread id. More...
 
local getCocos2dThreadId ()
 returns the cocos2d thread id. More...
 
- Public Member Functions inherited from Ref
void retain ()
 Retains the ownership. More...
 
local retain ()
 Retains the ownership. More...
 
void release ()
 Releases the ownership immediately. More...
 
Refautorelease ()
 Releases the ownership sometime soon automatically. More...
 
unsigned int getReferenceCount () const
 Returns the Ref's current reference count. More...
 
local getReferenceCount ()
 Returns the Ref's current reference count. More...
 
virtual ~Ref ()
 Destructor.
 

Additional Inherited Members

- Public Types inherited from Director
enum  Projection { _2D, _3D, CUSTOM, DEFAULT = _3D }
 Possible OpenGL projections used by director. More...
 
- Static Public Member Functions inherited from Director
static DirectorgetInstance ()
 Returns a shared instance of the director.
 
var _getInstance ()
 Returns a shared instance of the director.
 
local getInstance ()
 Returns a shared instance of the director.
 
static DirectorsharedDirector ()
- Public Attributes inherited from Ref
unsigned int _ID
 object id, ScriptSupport need public _ID
 
local _ID
 object id, ScriptSupport need public _ID
 
int _luaID
 Lua reference id.
 
local _luaID
 Lua reference id.
 
void * _scriptObject
 scriptObject, support for swift
 
local _scriptObject
 scriptObject, support for swift
 
bool _rooted
 When true, it means that the object was already rooted.
 
local _rooted
 When true, it means that the object was already rooted.
 
bool _scriptOwned
 The life of the object is scrolled by the scripting engine. More...
 
local _scriptOwned
 The life of the object is scrolled by the scripting engine. More...
 
- Static Public Attributes inherited from Director
static const char * EVENT_PROJECTION_CHANGED
 Director will trigger an event when projection type is changed.
 
static const char * EVENT_BEFORE_UPDATE
 Director will trigger an event before Schedule::update() is invoked. More...
 
static const char * EVENT_AFTER_UPDATE
 Director will trigger an event after Schedule::update() is invoked.
 
var EVENT_AFTER_UPDATE
 Director will trigger an event after Schedule::update() is invoked.
 
local EVENT_AFTER_UPDATE
 Director will trigger an event after Schedule::update() is invoked.
 
static const char * EVENT_AFTER_VISIT
 Director will trigger an event after Scene::render() is invoked.
 
var EVENT_AFTER_VISIT
 Director will trigger an event after Scene::render() is invoked.
 
local EVENT_AFTER_VISIT
 Director will trigger an event after Scene::render() is invoked.
 
static const char * EVENT_AFTER_DRAW
 Director will trigger an event after a scene is drawn, the data is sent to GPU.
 

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

Member Function Documentation

virtual void setAnimationInterval ( float  interval)
overridevirtual

Sets the FPS value.

FPS = 1

Implements Director.

var setAnimationInterval ( var  interval)
overridevirtual

Sets the FPS value.

FPS = 1

Implements Director.

local setAnimationInterval ( local  interval)
overridevirtual

Sets the FPS value.

FPS = 1

Implements Director.

virtual void startAnimation ( )
overridevirtual

The main loop is triggered again.

Call this function only if [stopAnimation] was called earlier. Don't call this function to start the main loop. To run the main loop call runWithScene.

Implements Director.

var startAnimation ( )
overridevirtual

The main loop is triggered again.

Call this function only if [stopAnimation] was called earlier. Don't call this function to start the main loop. To run the main loop call runWithScene.

Implements Director.

local startAnimation ( )
overridevirtual

The main loop is triggered again.

Call this function only if [stopAnimation] was called earlier. Don't call this function to start the main loop. To run the main loop call runWithScene.

Implements Director.

virtual void stopAnimation ( )
overridevirtual

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 Director.

var stopAnimation ( )
overridevirtual

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 Director.

local stopAnimation ( )
overridevirtual

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 Director.


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