Beispiel #1
0
        protected virtual bool InitWithWidthAndHeight(int w, int h, SurfaceFormat colorFormat, DepthFormat depthFormat, RenderTargetUsage usage)
        {
            w = (w * CCMacros.CCContentScaleFactor());
            h = (h * CCMacros.CCContentScaleFactor());

            m_pTexture = new CCTexture2D();
            m_pTexture.SetAliasTexParameters();

            m_pRenderTarget2D = DrawManager.CreateRenderTarget(w, h, colorFormat, depthFormat, usage);
            m_pTexture.InitWithTexture(m_pRenderTarget2D);

            m_bFirstUsage = true;

            m_pSprite = new CCSprite(m_pTexture);
            //m_pSprite.scaleY = -1;
            m_pSprite.BlendFunc = new CCBlendFunc(CCMacros.CCDefaultSourceBlending, CCMacros.CCDefaultDestinationBlending); // OGLES.GL_ONE, OGLES.GL_ONE_MINUS_SRC_ALPHA);

            AddChild(m_pSprite);

            return true;
        }