void NativeTextureGLES::updateRegion(int x, int y, const ImageData& data_)
    {
        ImageData data = data_;
        assert(_width >= data.w - x);
        assert(_height >= data.h - y);
        glBindTexture(GL_TEXTURE_2D, (GLuint) _id);

        glPixel glp = SurfaceFormat2GL(_format);
        //saveImage(data, "test1.png");


        MemoryTexture mt;
        if (_format != data.format)
        {
            mt.init(data.w, data.h, _format);
            mt.fill_zero();
            mt.updateRegion(0, 0, data);
            data = mt.lock();
        }

        glTexSubImage2D(GL_TEXTURE_2D, 0,
                        x, y, data.w, data.h,
                        glp.format, glp.type, data.data);
        CHECKGL();
    }
    void STDRenderer::restore()
    {
        MemoryTexture memwhite;
        memwhite.init(4, 4, TF_R8G8B8A8);

        oxygine::operations::op_fill fill;
        ImageData im = memwhite.lock();
        oxygine::operations::applyOperation(fill, im);

        white = IVideoDriver::instance->createTexture();
        white->setName("!renderer. white");
        white->init(im, false);
        white->setLinearFilter(false);


        memwhite.fill_zero();
        invisible = IVideoDriver::instance->createTexture();
        invisible->setName("!renderer. invisible");
        invisible->init(im, false);
        invisible->setLinearFilter(false);

        setDefaultSettings();
        _restored = true;
    }