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


C++ MyAvatar::renderHeadMouse方法代码示例

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


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

示例1: renderOverlay

// Renders the overlays either to a texture or to the screen
void ApplicationOverlay::renderOverlay(bool renderToTexture) {
    PerformanceWarning warn(Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings), "ApplicationOverlay::displayOverlay()");

    Application* application = Application::getInstance();

    Overlays& overlays = application->getOverlays();
    QGLWidget* glWidget = application->getGLWidget();
    MyAvatar* myAvatar = application->getAvatar();

    if (renderToTexture) {
        getFramebufferObject()->bind();
        glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
    }
    glEnable(GL_BLEND);
    glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);

    // Render 2D overlay
    glMatrixMode(GL_PROJECTION);
    glPushMatrix();

    glLoadIdentity();
    gluOrtho2D(0, glWidget->width(), glWidget->height(), 0);
    glDisable(GL_DEPTH_TEST);
    glDisable(GL_LIGHTING);

    renderAudioMeter();

    if (Menu::getInstance()->isOptionChecked(MenuOption::HeadMouse)) {
        myAvatar->renderHeadMouse(glWidget->width(), glWidget->height());
    }

    renderStatsAndLogs();

    // give external parties a change to hook in
    emit application->renderingOverlay();

    overlays.render2D();

    renderPointers();

    glPopMatrix();

    glMatrixMode(GL_MODELVIEW);
    glEnable(GL_DEPTH_TEST);
    glEnable(GL_LIGHTING);
    glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_CONSTANT_ALPHA, GL_ONE);

    if (renderToTexture) {
        getFramebufferObject()->release();
    }
}
开发者ID:BrianPrz,项目名称:hifi,代码行数:52,代码来源:ApplicationOverlay.cpp

示例2: renderOverlay

// Renders the overlays either to a texture or to the screen
void ApplicationOverlay::renderOverlay(bool renderToTexture) {
    PerformanceWarning warn(Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings), "ApplicationOverlay::displayOverlay()");
    Application* application = Application::getInstance();
    Overlays& overlays = application->getOverlays();
    GLCanvas* glWidget = application->getGLWidget();
    MyAvatar* myAvatar = application->getAvatar();
    
    _textureFov = glm::radians(Menu::getInstance()->getOculusUIAngularSize());
    _textureAspectRatio = (float)application->getGLWidget()->getDeviceWidth() / (float)application->getGLWidget()->getDeviceHeight();

    //Handle fading and deactivation/activation of UI
    if (Menu::getInstance()->isOptionChecked(MenuOption::UserInterface)) {
        _alpha += FADE_SPEED;
        if (_alpha > 1.0f) {
            _alpha = 1.0f;
        }
    } else {
        _alpha -= FADE_SPEED;
        if (_alpha <= 0.0f) {
            _alpha = 0.0f;
        }
    }

    // Render 2D overlay
    glMatrixMode(GL_PROJECTION);
    glDisable(GL_DEPTH_TEST);
    glDisable(GL_LIGHTING);
    glEnable(GL_BLEND);
    glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
    if (renderToTexture) {
        _overlays.buildFramebufferObject();
        _overlays.bind();
        glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
    }
    
    glPushMatrix(); {
        glLoadIdentity();
        gluOrtho2D(0, glWidget->width(), glWidget->height(), 0);
        
        renderAudioMeter();
        
        if (Menu::getInstance()->isOptionChecked(MenuOption::HeadMouse)) {
            myAvatar->renderHeadMouse(glWidget->width(), glWidget->height());
        }
        
        renderStatsAndLogs();
        
        // give external parties a change to hook in
        emit application->renderingOverlay();
        
        overlays.render2D();
        
        renderPointers();
        
        renderDomainConnectionStatusBorder();
    } glPopMatrix();

    glMatrixMode(GL_MODELVIEW);
    glEnable(GL_DEPTH_TEST);
    glEnable(GL_LIGHTING);
    glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_CONSTANT_ALPHA, GL_ONE);

    if (renderToTexture) {
        _overlays.release();
    }
}
开发者ID:dimentox,项目名称:hifi,代码行数:67,代码来源:ApplicationOverlay.cpp


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