Exemplo n.º 1
0
        public virtual bool Init()
        {
            SetDefaultValues();

            // scenes
            m_pRunningScene = null;
            m_pNextScene = null;

            m_pNotificationNode = null;

            m_dOldAnimationInterval = m_dAnimationInterval = 1.0 / kDefaultFPS;

            // Set default projection (3D)
            m_eProjection = CCDirectorProjection.Default;

            // projection delegate if "Custom" projection is used
            m_pProjectionDelegate = null;

            // FPS
            m_fAccumDt = 0.0f;
            m_pFPSLabel = null;
            m_pUpdateTimeLabel = null;
            m_pDrawTimeLabel = null;
            m_pDrawsLabel = null;
            m_bDisplayStats = false;
            m_uTotalFrames = 0;

            m_pStopwatch = new Stopwatch();

            // paused ?
            m_bPaused = false;

            // purge ?
            m_bPurgeDirecotorInNextLoop = false;

            m_obWinSizeInPoints = CCSize.Zero;

            //m_pobOpenGLView = null;

            m_fContentScaleFactor = 1.0f;

            // scheduler
            m_pScheduler = new CCScheduler();
            // action manager
            m_pActionManager = new CCActionManager();
            m_pScheduler.ScheduleUpdateForTarget(m_pActionManager, CCScheduler.kCCPrioritySystem, false);
            // touchDispatcher
            m_pTouchDispatcher = new CCTouchDispatcher();
            m_pTouchDispatcher.Init();

            // KeypadDispatcher
            m_pKeypadDispatcher = new CCKeypadDispatcher();

			// KeyboardDispatcher
			m_pKeyboardDispatcher = new CCKeyboardDispatcher();

			// Accelerometer
#if !PSM &&!NETFX_CORE
            m_pAccelerometer = new CCAccelerometer();
#endif
            // create autorelease pool
            //CCPoolManager::sharedPoolManager()->push();

            m_NeedsInit = false;
            return true;
        }
Exemplo n.º 2
0
        public virtual bool Init()
        {
            SetDefaultValues();

            // scenes
            m_pRunningScene = null;
            m_pNextScene    = null;

            m_pNotificationNode = null;

            m_dOldAnimationInterval = m_dAnimationInterval = 1.0 / kDefaultFPS;

            // Set default projection (3D)
            m_eProjection = CCDirectorProjection.Default;

            // projection delegate if "Custom" projection is used
            m_pProjectionDelegate = null;

            // FPS
            m_fAccumDt         = 0.0f;
            m_pFPSLabel        = null;
            m_pUpdateTimeLabel = null;
            m_pDrawTimeLabel   = null;
            m_pDrawsLabel      = null;
            m_bDisplayStats    = false;
            m_uTotalFrames     = 0;

            m_pStopwatch = new Stopwatch();

            // paused ?
            m_bPaused = false;

            // purge ?
            m_bPurgeDirectorInNextLoop = false;

            m_obWinSizeInPoints = CCSize.Zero;

            //m_pobOpenGLView = null;

            m_fContentScaleFactor = 1.0f;

            // scheduler
            m_pScheduler = new CCScheduler();
            // action manager
            m_pActionManager = new CCActionManager();
            m_pScheduler.ScheduleUpdateForTarget(m_pActionManager, CCScheduler.kCCPrioritySystem, false);
            // touchDispatcher
            m_pTouchDispatcher = new CCTouchDispatcher();
            m_pTouchDispatcher.Init();

            // KeypadDispatcher
            m_pKeypadDispatcher = new CCKeypadDispatcher();

            // KeyboardDispatcher
            m_pKeyboardDispatcher = new CCKeyboardDispatcher();

            // Accelerometer
#if !PSM && !NETFX_CORE
            m_pAccelerometer = new CCAccelerometer();
#endif

            m_NeedsInit = false;
            return(true);
        }