/// <summary>
        ///  initializes a RenderTexture object with width and height in Points and a pixel format, only RGB and RGBA formats are valid 
        /// </summary>
        /// <param name="w"></param>
        /// <param name="h"></param>
        /// <param name="eFormat"></param>
        /// <returns></returns>
        public bool initWithWidthAndHeight(int w, int h, CCTexture2DPixelFormat eFormat)
        {
            // If the gles version is lower than GLES_VER_1_0,
            // some extended gles functions can't be implemented, so return false directly.
            if (CCConfiguration.sharedConfiguration().getGlesVersion() <= CCGlesVersion.GLES_VER_1_0)
            {
                return false;
            }

            bool bRet = false;
            do
            {
                w = (int)CCDirector.sharedDirector().ContentScaleFactor;
                h = (int)CCDirector.sharedDirector().ContentScaleFactor;

                //glGetIntegerv(0x8CA6, m_nOldFBO);

                // textures must be power of two squared
                uint powW = (uint)ccUtils.ccNextPOT(w);
                uint powH = (uint)ccUtils.ccNextPOT(h);

                var data = (int)(powW * powH * 4);
                //CC_BREAK_IF(! data);

                //memset(data, 0, (int)(powW * powH * 4));
                //m_ePixelFormat = eFormat;

                m_pTexture = new CCTexture2D();
                //CC_BREAK_IF(! m_pTexture);

                m_pTexture.initWithData(data, (CCTexture2DPixelFormat)m_ePixelFormat, powW, powH, new CCSize((float)w, (float)h));
                //free( data );

                // generate FBO
                //ccglGenFramebuffers(1, &m_uFBO);
                //ccglBindFramebuffer(CC_GL_FRAMEBUFFER, m_uFBO);

                // associate texture with FBO
                //ccglFramebufferTexture2D(CC_GL_FRAMEBUFFER, CC_GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, m_pTexture->getName(), 0);

                // check if it worked (probably worth doing :) )
                //GLuint status = ccglCheckFramebufferStatus(CC_GL_FRAMEBUFFER);
                //if (status != CC_GL_FRAMEBUFFER_COMPLETE)
                //{
                //    CCAssert(0, "Render Texture : Could not attach texture to framebuffer");
                //    CC_SAFE_DELETE(m_pTexture);
                //    break;
                //}

                m_pTexture.setAliasTexParameters();

                m_pSprite = CCSprite.spriteWithTexture(m_pTexture);

                //m_pTexture->release();
                m_pSprite.scaleY = -1;
                this.addChild(m_pSprite);

                ccBlendFunc tBlendFunc = new ccBlendFunc { src = 1, dst = 0x0303 };
                m_pSprite.BlendFunc = tBlendFunc;

                //ccglBindFramebuffer(CC_GL_FRAMEBUFFER, m_nOldFBO);
                bRet = true;
            } while (true);
            return bRet;
        }