Example #1
0
        public virtual bool init()
        {
            double num  = 1 / this.kDefaultFPS;
            double num1 = num;

            this.m_dAnimationInterval    = num;
            this.m_dOldAnimationInterval = num1;
            this.m_eProjection           = ccDirectorProjection.kCCDirectorProjection3D;
            this.m_bDisplayFPS           = false;
            int  num2 = 0;
            uint num3 = (uint)num2;

            this.m_uFrames      = (uint)num2;
            this.m_uTotalFrames = num3;
            this.m_pszFPS       = "";
            this.m_bPaused      = false;
            this.m_bPaused      = false;
            this.m_bPurgeDirecotorInNextLoop = false;
            CCSize cCSize  = new CCSize(0f, 0f);
            CCSize cCSize1 = cCSize;

            this.m_obWinSizeInPoints        = cCSize;
            this.m_obWinSizeInPixels        = cCSize1;
            this.m_eDeviceOrientation       = ccDeviceOrientation.kCCDeviceOrientationPortrait;
            this.m_bRetinaDisplay           = false;
            this.m_fContentScaleFactor      = 1f;
            this.m_bIsContentScaleSupported = false;
            return(true);
        }
Example #2
0
        public virtual bool Init()
        {
            // scenes
            m_pRunningScene = null;
            m_pNextScene    = null;

            m_pNotificationNode = null;

            m_dOldAnimationInterval = m_dAnimationInterval = 1.0 / kDefaultFPS;

            // Set default projection (3D)
            m_eProjection = ccDirectorProjection.kCCDirectorProjectionDefault;

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

            // FPS
            m_fAccumDt      = 0.0f;
            m_fFrameRate    = 0.0f;
            m_pFPSLabel     = null;
            m_pSPFLabel     = null;
            m_pDrawsLabel   = null;
            m_bDisplayStats = false;
            m_uTotalFrames  = m_uFrames = 0;

            // paused ?
            m_bPaused = false;

            // purge ?
            m_bPurgeDirecotorInNextLoop = false;

            m_obWinSizeInPixels = 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();

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

            m_NeedsInit = false;
            return(true);
        }
Example #3
0
        public virtual void BeforeDraw()
        {
            m_directorProjection = CCDirector.SharedDirector.Projection;

            m_pGrabber.BeforeRender(m_pTexture);

            Set2DProjection();
        }
Example #4
0
        public short[] getIndexes(ccDirectorProjection projection)
        {
            short[] indexes = new short[6];

            indexes[0] = 0;
            indexes[1] = 1;
            indexes[2] = 2;
            indexes[3] = 2;
            indexes[4] = 1;
            indexes[5] = 3;

            return(indexes);
        }
Example #5
0
        public VertexPositionColorTexture[] getVertices(ccDirectorProjection projection)
        {
            VertexPositionColorTexture[] vertices = new VertexPositionColorTexture[4];

            if (projection == ccDirectorProjection.kCCDirectorProjection2D)
            {
                vertices[0] = new VertexPositionColorTexture(
                    new Vector3(this.bl.vertices.x, this.bl.vertices.y, this.bl.vertices.z),
                    new Color(this.tl.colors.r, this.tl.colors.g, this.tl.colors.b, this.tl.colors.a),
                    new Vector2(this.bl.texCoords.u, this.bl.texCoords.v));

                vertices[1] = new VertexPositionColorTexture(
                    new Vector3(this.br.vertices.x, this.br.vertices.y, this.br.vertices.z),
                    new Color(this.tr.colors.r, this.tr.colors.g, this.tr.colors.b, this.tr.colors.a),
                    new Vector2(this.br.texCoords.u, this.br.texCoords.v));

                vertices[2] = new VertexPositionColorTexture(
                    new Vector3(this.tl.vertices.x, this.tl.vertices.y, this.tl.vertices.z),
                    new Color(this.bl.colors.r, this.bl.colors.g, this.bl.colors.b, this.bl.colors.a),
                    new Vector2(this.tl.texCoords.u, this.tl.texCoords.v));

                vertices[3] = new VertexPositionColorTexture(
                    new Vector3(this.tr.vertices.x, this.tr.vertices.y, this.tr.vertices.z),
                    new Color(this.br.colors.r, this.br.colors.g, this.br.colors.b, this.br.colors.a),
                    new Vector2(this.tr.texCoords.u, this.tr.texCoords.v));
            }
            else
            {
                vertices[0] = new VertexPositionColorTexture(
                    new Vector3(this.tl.vertices.x, this.tl.vertices.y, this.tl.vertices.z),
                    new Color(this.tl.colors.r, this.tl.colors.g, this.tl.colors.b, this.tl.colors.a),
                    new Vector2(this.tl.texCoords.u, this.tl.texCoords.v));

                vertices[1] = new VertexPositionColorTexture(
                    new Vector3(this.tr.vertices.x, this.tr.vertices.y, this.tr.vertices.z),
                    new Color(this.tr.colors.r, this.tr.colors.g, this.tr.colors.b, this.tr.colors.a),
                    new Vector2(this.tr.texCoords.u, this.tr.texCoords.v));

                vertices[2] = new VertexPositionColorTexture(
                    new Vector3(this.bl.vertices.x, this.bl.vertices.y, this.bl.vertices.z),
                    new Color(this.bl.colors.r, this.bl.colors.g, this.bl.colors.b, this.bl.colors.a),
                    new Vector2(this.bl.texCoords.u, this.bl.texCoords.v));

                vertices[3] = new VertexPositionColorTexture(
                    new Vector3(this.br.vertices.x, this.br.vertices.y, this.br.vertices.z),
                    new Color(this.br.colors.r, this.br.colors.g, this.br.colors.b, this.br.colors.a),
                    new Vector2(this.br.texCoords.u, this.br.texCoords.v));
            }

            return(vertices);
        }
Example #6
0
        public virtual bool Init()
        {
            // scenes
            m_pRunningScene = null;
            m_pNextScene = null;

            m_pNotificationNode = null;

            m_dOldAnimationInterval = m_dAnimationInterval = 1.0 / kDefaultFPS;

            // Set default projection (3D)
            m_eProjection = ccDirectorProjection.kCCDirectorProjectionDefault;

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

            // FPS
            m_fAccumDt = 0.0f;
            m_fFrameRate = 0.0f;
            m_pFPSLabel = null;
            m_pSPFLabel = null;
            m_pDrawsLabel = null;
            m_bDisplayStats = false;
            m_uTotalFrames = m_uFrames = 0;

            // paused ?
            m_bPaused = false;

            // purge ?
            m_bPurgeDirecotorInNextLoop = false;

            m_obWinSizeInPixels = 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();

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

            m_NeedsInit = false;
            return true;
        }
Example #7
0
        public virtual void BeforeDraw()
        {
            m_directorProjection = CCDirector.SharedDirector.Projection;

            m_pGrabber.BeforeRender(m_pTexture);

            Set2DProjection();
        }
        public virtual bool init()
        {
            //scene
            m_dOldAnimationInterval = m_dAnimationInterval = 1.0 / kDefaultFPS;

            // Set default projection (3D)
            m_eProjection = ccDirectorProjection.kCCDirectorProjectionDefault;

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

            //FPS
            m_bDisplayFPS = false;
            m_uTotalFrames = m_uFrames = 0;
            m_pszFPS = "";

            m_bPaused = false;

            //paused?
            m_bPaused = false;

            //purge?
            m_bPurgeDirecotorInNextLoop = false;

            m_obWinSizeInPixels = m_obWinSizeInPoints = new CCSize(0, 0);

            // portrait mode default
            m_eDeviceOrientation = ccDeviceOrientation.CCDeviceOrientationPortrait;

            m_bRetinaDisplay = false;
            m_fContentScaleFactor = 1;
            m_bIsContentScaleSupported = false;

            return true;
        }
Example #9
0
 public short[] getIndexes(ccDirectorProjection projection)
 {
     short[] numArray = new short[] { 0, 1, 2, 2, 1, 3 };
     return(numArray);
 }
Example #10
0
        public VertexPositionColorTexture[] getVertices(ccDirectorProjection projection)
        {
            VertexPositionColorTexture[] vertices = new VertexPositionColorTexture[4];

            if (projection == ccDirectorProjection.kCCDirectorProjection2D)
            {
                vertices[0] = new VertexPositionColorTexture(
                    new Vector3(this.bl.vertices.x, this.bl.vertices.y, this.bl.vertices.z),
                    new Color(this.tl.colors.r, this.tl.colors.g, this.tl.colors.b, this.tl.colors.a),
                    new Vector2(this.bl.texCoords.u, this.bl.texCoords.v));

                vertices[1] = new VertexPositionColorTexture(
                    new Vector3(this.br.vertices.x, this.br.vertices.y, this.br.vertices.z),
                    new Color(this.tr.colors.r, this.tr.colors.g, this.tr.colors.b, this.tr.colors.a),
                    new Vector2(this.br.texCoords.u, this.br.texCoords.v));

                vertices[2] = new VertexPositionColorTexture(
                    new Vector3(this.tl.vertices.x, this.tl.vertices.y, this.tl.vertices.z),
                    new Color(this.bl.colors.r, this.bl.colors.g, this.bl.colors.b, this.bl.colors.a),
                    new Vector2(this.tl.texCoords.u, this.tl.texCoords.v));

                vertices[3] = new VertexPositionColorTexture(
                    new Vector3(this.tr.vertices.x, this.tr.vertices.y, this.tr.vertices.z),
                    new Color(this.br.colors.r, this.br.colors.g, this.br.colors.b, this.br.colors.a),
                    new Vector2(this.tr.texCoords.u, this.tr.texCoords.v));
            }
            else
            {
                vertices[0] = new VertexPositionColorTexture(
                    new Vector3(this.tl.vertices.x, this.tl.vertices.y, this.tl.vertices.z),
                    new Color(this.tl.colors.r, this.tl.colors.g, this.tl.colors.b, this.tl.colors.a),
                    new Vector2(this.tl.texCoords.u, this.tl.texCoords.v));

                vertices[1] = new VertexPositionColorTexture(
                    new Vector3(this.tr.vertices.x, this.tr.vertices.y, this.tr.vertices.z),
                    new Color(this.tr.colors.r, this.tr.colors.g, this.tr.colors.b, this.tr.colors.a),
                    new Vector2(this.tr.texCoords.u, this.tr.texCoords.v));

                vertices[2] = new VertexPositionColorTexture(
                    new Vector3(this.bl.vertices.x, this.bl.vertices.y, this.bl.vertices.z),
                    new Color(this.bl.colors.r, this.bl.colors.g, this.bl.colors.b, this.bl.colors.a),
                     new Vector2(this.bl.texCoords.u, this.bl.texCoords.v));

                vertices[3] = new VertexPositionColorTexture(
                    new Vector3(this.br.vertices.x, this.br.vertices.y, this.br.vertices.z),
                    new Color(this.br.colors.r, this.br.colors.g, this.br.colors.b, this.br.colors.a),
                    new Vector2(this.br.texCoords.u, this.br.texCoords.v));
            }

            return vertices;
        }
Example #11
0
        public short[] getIndexes(ccDirectorProjection projection)
        {
            short[] indexes = new short[6];

            indexes[0] = 0;
            indexes[1] = 1;
            indexes[2] = 2;
            indexes[3] = 2;
            indexes[4] = 1;
            indexes[5] = 3;

            return indexes;
        }