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


C++ intrusive_ptr::create方法代码示例

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


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

示例1: drawSceneToTarget

        void drawSceneToTarget()
        {
            if (!targetTexture_ ||
                targetTexture_->getWidth() != 2 * window_->getWidth() ||
                targetTexture_->getHeight() != 2 * window_->getHeight())
            {
                targetTexture_ = window_->getContext()->createTexture();
                targetTexture_->setSize(2 * window_->getWidth(),
                                        2 * window_->getHeight());
                targetTexture_->setMinFilter(GL_LINEAR);
                targetTexture_->setMagFilter(GL_LINEAR);

                targetFrameBuffer_ = window_->getContext()->createFrameBuffer();
                targetFrameBuffer_->setColorAttachment(targetTexture_);
            }
            
            targetFrameBuffer_->create();

            glViewport(0, 0, window_->getWidth() * 2,
                       window_->getHeight() * 2);
            glBindFramebuffer(GL_FRAMEBUFFER, targetFrameBuffer_->getName());
            glClearColor(0.0, 0.0, 0.0, 0.0);
            glClear(GL_COLOR_BUFFER_BIT);
            drawScene();
            glBindFramebuffer(GL_FRAMEBUFFER, 0);
            glViewport(0, 0, window_->getWidth(), window_->getHeight());
        }
开发者ID:elemel,项目名称:mortified,代码行数:27,代码来源:game_screen.cpp

示例2: drawLogoToTarget

    void drawLogoToTarget()
    {
        logoTexture_->create();
        targetFrameBuffer_->create();

        glViewport(0, 0, targetTexture_->getWidth(),
                   targetTexture_->getHeight());

        glMatrixMode(GL_PROJECTION);
        glLoadIdentity();
        glOrtho(-1.0, 1.0, -1.0, 1.0, -1.0, 1.0);
        glMatrixMode(GL_MODELVIEW);
        glLoadIdentity();

        float aspectRatio = (float(logoTexture_->getWidth()) /
                             float(logoTexture_->getHeight()));
        float scale = 0.2f;

        glBindFramebuffer(GL_FRAMEBUFFER, targetFrameBuffer_->getName());
        glClearColor(0.0, 0.0, 0.0, 0.0);
        glClear(GL_COLOR_BUFFER_BIT);
        glEnable(GL_BLEND);
        glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
        glEnable(GL_TEXTURE_2D);
        glBindTexture(GL_TEXTURE_2D, logoTexture_->getName());
        glPushMatrix();
        glRotatef(angle_, 0.0f, 0.0f, 1.0f);
        glColor3f(1.0f, 0.8f, 0.2f);
        glBegin(GL_QUADS);
        {
            glTexCoord2i(0, 0);
            glVertex2f(-scale * aspectRatio, -scale);
            glTexCoord2i(1, 0);
            glVertex2f(scale * aspectRatio, -scale);
            glTexCoord2i(1, 1);
            glVertex2f(scale * aspectRatio, scale);
            glTexCoord2i(0, 1);
            glVertex2f(-scale * aspectRatio, scale);
        }
        glEnd();
        glPopMatrix();
        glBindTexture(GL_TEXTURE_2D, 0);
        glDisable(GL_TEXTURE_2D);
        glDisable(GL_BLEND);
        glBindFramebuffer(GL_FRAMEBUFFER, 0);
    }
开发者ID:elemel,项目名称:mortified,代码行数:46,代码来源:title_screen.cpp

示例3: drawScene

 void drawScene()
 {
     program_->create();
     program_->bind();
     applyCamera();
     glEnable(GL_BLEND);
     glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
     game_->getRenderService()->draw();
     glDisable(GL_BLEND);
     program_->unbind();
 }
开发者ID:elemel,项目名称:mortified,代码行数:11,代码来源:game_screen.cpp


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