当前位置: 首页>>代码示例>>C++>>正文


C++ Attributes::testFlag方法代码示例

本文整理汇总了C++中Attributes::testFlag方法的典型用法代码示例。如果您正苦于以下问题:C++ Attributes::testFlag方法的具体用法?C++ Attributes::testFlag怎么用?C++ Attributes::testFlag使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Attributes的用法示例。


在下文中一共展示了Attributes::testFlag方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: updateOpacityForDisabledWidgets

 void updateOpacityForDisabledWidgets()
 {
     float const opac = (self().isDisabled()? .3f : 1.f);
     if (opacityWhenDisabled.target() != opac)
     {
         opacityWhenDisabled.setValue(opac, .3f);
     }
     if (firstUpdateAfterCreation ||
        !attribs.testFlag(AnimateOpacityWhenEnabledOrDisabled))
     {
         opacityWhenDisabled.finish();
     }
 }
开发者ID:,项目名称:,代码行数:13,代码来源:

示例2: drawBlurredBackground

    void drawBlurredBackground()
    {
        if (background.type == Background::SharedBlur ||
            background.type == Background::SharedBlurWithBorderGlow)
        {
            // Use another widget's blur.
            DENG2_ASSERT(background.blur != 0);
            if (background.blur)
            {
                background.blur->drawBlurredRect(self().rule().recti(), background.solidFill);
            }
            return;
        }

        if (background.type != Background::Blurred &&
            background.type != Background::BlurredWithBorderGlow &&
            background.type != Background::BlurredWithSolidFill)
        {
            deinitBlur();
            return;
        }

        // Make sure blurring is initialized.
        initBlur();

        DENG2_ASSERT(blur->fb[0]->isReady());

        // Pass 1: render all the widgets behind this one onto the first blur
        // texture, downsampled.
        GLState::push()
                .setTarget(*blur->fb[0])
                .setViewport(Rectangleui::fromSize(blur->size));
        blur->fb[0]->clear(GLFramebuffer::Depth);
        self().root().drawUntil(self());
        GLState::pop();

        blur->fb[0]->resolveSamples();

        // Pass 2: apply the horizontal blur filter to draw the background
        // contents onto the second blur texture.
        GLState::push()
                .setTarget(*blur->fb[1])
                .setViewport(Rectangleui::fromSize(blur->size));
        blur->uTex = blur->fb[0]->colorTexture();
        blur->uMvpMatrix = Matrix4f::ortho(0, 1, 0, 1);
        blur->uWindow = Vector4f(0, 0, 1, 1);
        blur->drawable.setProgram(blur->drawable.program());
        blur->drawable.draw();
        GLState::pop();

        blur->fb[1]->resolveSamples();

        // Pass 3: apply the vertical blur filter, drawing the final result
        // into the original target.
        Vector4f blurColor = background.solidFill;
        float blurOpacity  = self().visibleOpacity();
        if (background.type == Background::BlurredWithSolidFill)
        {
            blurColor.w = 1;
        }
        if (!attribs.testFlag(DontDrawContent) && blurColor.w > 0 && blurOpacity > 0)
        {
            self().drawBlurredRect(self().rule().recti(), blurColor, blurOpacity);
        }
    }
开发者ID:,项目名称:,代码行数:65,代码来源:


注:本文中的Attributes::testFlag方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。