Exemplo n.º 1
0
void GridBase::afterDraw(cocos2d::Node *target)
{
    _grabber->afterRender(_texture);

    // restore projection
    Director *director = Director::getInstance();
    director->setProjection(_directorProjection);

    director->setViewport();
    const auto& vp = Camera::getDefaultViewport();
    glViewport(vp._left, vp._bottom, vp._width, vp._height);
//    if (target->getCamera()->isDirty())
//    {
//        Vec2 offset = target->getAnchorPointInPoints();
//
//        //
//        // FIXME: Camera should be applied in the AnchorPoint
//        //
//        kmGLTranslatef(offset.x, offset.y, 0);
//        target->getCamera()->locate();
//        kmGLTranslatef(-offset.x, -offset.y, 0);
//    }

    GL::bindTexture2D(_texture->getName());

    // restore projection for default FBO .fixed bug #543 #544
    //TODO:         Director::getInstance()->setProjection(Director::getInstance()->getProjection());
    //TODO:         Director::getInstance()->applyOrientation();
    beforeBlit();
    blit();
    afterBlit();
}
Exemplo n.º 2
0
void GridBase::afterDraw(cocos2d::Node *target)
{
    _grabber->afterRender(_texture);

    // restore projection
    Director *director = Director::DirectorInstance;
    director->setProjection(_directorProjection);

    GL::bindTexture2D(_texture->getName());

    // restore projection for default FBO .fixed bug #543 #544
    //TODO:         Director::getInstance()->setProjection(Director::getInstance()->getProjection());
    //TODO:         Director::getInstance()->applyOrientation();
    beforeBlit();
    blit();
    afterBlit();
}