• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ renderLater函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中renderLater函数的典型用法代码示例。如果您正苦于以下问题:C++ renderLater函数的具体用法?C++ renderLater怎么用?C++ renderLater使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: renderLater

//----------------------------------------------------------------------------------------------------------------------
void NGLScene::mouseMoveEvent (QMouseEvent * _event)
{
  // note the method buttons() is the button state when event was called
  // this is different from button() which is used to check which button was
  // pressed when the mousePress/Release event is generated
  if(m_rotate && _event->buttons() == Qt::LeftButton)
  {
    int diffx=_event->x()-m_origX;
    int diffy=_event->y()-m_origY;
    m_spinXFace += (float) 0.5f * diffy;
    m_spinYFace += (float) 0.5f * diffx;
    m_origX = _event->x();
    m_origY = _event->y();
    renderLater();

  }
        // right mouse translate code
  else if(m_translate && _event->buttons() == Qt::RightButton)
  {
    int diffX = (int)(_event->x() - m_origXPos);
    int diffY = (int)(_event->y() - m_origYPos);
    m_origXPos=_event->x();
    m_origYPos=_event->y();
    m_modelPos.m_x += INCREMENT * diffX;
    m_modelPos.m_y -= INCREMENT * diffY;
    renderLater();

   }
}
开发者ID:NCCA,项目名称:NGL6Demos,代码行数:30,代码来源:NGLScene.cpp


示例2: QOpenGLContext

void MainWindow::renderNow()
{

    if (!isExposed())
        return;


    updatePending = false;

    bool needsInitialize = false;

    if (!context) {
        context = new QOpenGLContext(this);
        context->setFormat(requestedFormat());
        context->create();

        needsInitialize = true;
    }

    context->makeCurrent(this);

    if (world)
        world->simulate(timer.elapsed());
    timer.start();

    if (needsInitialize) {
        initializeOpenGLFunctions();
    }

    render();

    context->swapBuffers(this);
    if (animating)
        renderLater();
}
开发者ID:null0000,项目名称:MOV,代码行数:35,代码来源:mainwindow.cpp


示例3: renderLater

void MyGLWidget::setAnimating(bool animating)
{
    m_animating = animating;

    if (animating)
        renderLater();
}
开发者ID:darwikey,项目名称:PFA-2D-3D,代码行数:7,代码来源:MyGLWidget.cpp


示例4: renderLater

//! [5]
void OpenGLWindow::setAnimating(bool animating)
{
    m_animating = animating;

    if (animating)
        renderLater();
}
开发者ID:vdoom,项目名称:OpenGLEperemental,代码行数:8,代码来源:openglwindow.cpp


示例5: initialize

void MainWindow::renderNow()
{
    if (!isExposed())
        return;

    calc->stop();

    m_update_pending = false;

    if (!m_context) {
        initialize();
    } else {
        m_context->makeCurrent(this);
    }

    render();
    m_context->swapBuffers(this);
    renderLater();

    counter++;
    if (counter >= 60 * 3600)
        counter = 0;

    emit needCalc();
}
开发者ID:wKich,项目名称:barnes-hut-sim,代码行数:25,代码来源:mainwindow.cpp


示例6: render

void QOgreWindow::renderNow()
{
    if (!isExposed()) return;
    if (oRoot == NULL) initialize();
    render();
    if (isAnimating) renderLater();
}
开发者ID:ZaibatsuTEAM,项目名称:PoneNgine,代码行数:7,代码来源:qogrewindow.cpp


示例7: qDebug

// Triggered when releasing any mouse button
void MainWindow::mouseReleaseEvent(QMouseEvent *ev)
{
    qDebug() << "Mouse button released" << ev->button();
    rotate = false;

    renderLater();
}
开发者ID:dududcbier,项目名称:ComputerGraphics,代码行数:8,代码来源:mainwindow.cpp


示例8: QOpenGLContext

void OpenGLWindow::renderNow()
{
    // end function if window is not visible
    if (!isExposed())
        return;

    bool needsInitialize = false;

    /*QOpenGLContext represents the OpenGL state of an underlying OpenGL context.
    To set up a context, set its screen and format such that they match those of the surface
    or surfaces with which the context is meant to be used.*/
    if (!m_context) {
        m_context = new QOpenGLContext(this);
        m_context->setFormat(requestedFormat());
        m_context->create();

        needsInitialize = true;
    }

    m_context->makeCurrent(this);

    if (needsInitialize) {
        // intern OpenGL function
        initializeOpenGLFunctions();
        initialize();
    }

    render();

    m_context->swapBuffers(this);

    if (m_animating)
        renderLater();
}
开发者ID:gollabaer,项目名称:3DScanningLecture,代码行数:34,代码来源:mainwindow.cpp


示例9: switch

void NGLScene::keyPressEvent(QKeyEvent *_event)
{
  // this method is called every time the main window recives a key event.
  // we then switch on the key value and set the camera in the GLWindow
  switch (_event->key())
  {
  // escape key to quite
  case Qt::Key_Escape : QGuiApplication::exit(EXIT_SUCCESS); break;
  // turn on wirframe rendering
  case Qt::Key_W : glPolygonMode(GL_FRONT_AND_BACK,GL_LINE); break;
  // turn off wire frame
  case Qt::Key_S : glPolygonMode(GL_FRONT_AND_BACK,GL_FILL); break;
  // show full screen
  case Qt::Key_F : showFullScreen(); break;
  // show windowed
  case Qt::Key_N : showNormal(); break;
  case Qt::Key_Left : m_lightPosition.m_x-=0.5; break;
  case Qt::Key_Right : m_lightPosition.m_x+=0.5; break;
  case Qt::Key_Up : m_lightPosition.m_y+=0.5; break;
  case Qt::Key_Down : m_lightPosition.m_y-=0.5; break;
  case Qt::Key_I : m_lightPosition.m_z-=0.5; break;
  case Qt::Key_O : m_lightPosition.m_z+=0.5; break;

  default : break;
  }
  // finally update the GLWindow and re-draw
  //if (isExposed())
    renderLater();
}
开发者ID:NCCA,项目名称:NGL6Demos,代码行数:29,代码来源:NGLScene.cpp


示例10: switch

void NGLScene::keyPressEvent(QKeyEvent *_event)
{
  static bool fn=true;
  static bool vn=true;
  ngl::ShaderLib *shader=ngl::ShaderLib::instance();

  switch (_event->key())
  {
    case Qt::Key_Plus : m_normalSize+=0.01; break;
    case Qt::Key_Minus : m_normalSize-=0.01; break;
    case Qt::Key_1 :
      fn^=true;
      (*shader)["normalShader"]->use();
      shader->setShaderParam1i("drawFaceNormals",fn);
    break;
    case Qt::Key_2 :
      vn^=true;
      (*shader)["normalShader"]->use();
      shader->setShaderParam1i("drawVertexNormals",vn);
    break;
    case Qt::Key_S : m_modelName="sphere"; break;
    case Qt::Key_T : m_modelName="teapot"; break;
    case Qt::Key_C : m_modelName="cube"; break;
    case Qt::Key_Y : m_modelName="cylinder"; break;
    case Qt::Key_N : m_modelName="cone"; break;
    case Qt::Key_R : m_modelName="torus"; break;
    case Qt::Key_Escape : QApplication::quit(); break;


  }
 renderLater();
}
开发者ID:NCCA,项目名称:NGL6Demos,代码行数:32,代码来源:NGLScene.cpp


示例11: renderLater

//! [5]
void ventanaGL::setAnimating(bool animating)
{
    m_animating = animating;

    if (animating)
        renderLater();
}
开发者ID:joasanm,项目名称:Qt-Theremin,代码行数:8,代码来源:ventanaGL.cpp


示例12: QOpenGLContext

void OpenGLWindow::renderNow()
{
    if (!isExposed())
        return;

    m_update_pending = false;

    bool needsInitialize = false;

    if (!m_context) {
        m_context = new QOpenGLContext(this);
        m_context->setFormat(requestedFormat());
        m_context->create();

        needsInitialize = true;
    }

    m_context->makeCurrent(this);

    if (needsInitialize) {
        initializeOpenGLFunctions();
        initialize();
    }

    render();

    m_context->swapBuffers(this);

    if (m_animating)
        renderLater();
}
开发者ID:leonhardrocha,项目名称:Holoview,代码行数:31,代码来源:OpenGLWindow.cpp


示例13: renderLater

void RenderSurface::setAnimating(bool animating)
{
    m_animating = animating;

    if (animating)
        renderLater();
}
开发者ID:CodeAsm,项目名称:shadercap,代码行数:7,代码来源:RenderSurface.cpp


示例14: QOpenGLContext

void RenderSurface::renderNow(const float time)
{
    m_globalTime = time;

    //if (!isExposed())
        //return;

    bool needsInitialize = false;

    if (!m_context) {
        m_context = new QOpenGLContext(this);
        m_context->setFormat(requestedFormat());
        m_context->create();

        needsInitialize = true;
    }

    m_context->makeCurrent(this);

    if (needsInitialize) {
        initializeOpenGLFunctions();
        initialize();
    }

    render();

    m_context->swapBuffers(this);

    if (m_animating)
        renderLater();
}
开发者ID:CodeAsm,项目名称:shadercap,代码行数:31,代码来源:RenderSurface.cpp


示例15: switch

//==============================================================================	key Press Event
void MyGLWidget::keyPressEvent( QKeyEvent *pEvent )
{
    switch( pEvent->key() )
    {
        case Qt::Key_Escape:
            exit(0);
            break;

        case Qt::Key_R:
            fRotationX = 0.0f;
            fRotationY = 0.0f;
            fRotationZ = 0.0f;
            fMoveUpDown = 0.0f;
            fMoveLeftRight = 0.0f;
            fMoveInOut = 0.0f;
            break;

        case Qt::Key_Up:
        case Qt::Key_Z:
            fMoveUpDown += 0.6;
            break;

        case Qt::Key_Down:
        case Qt::Key_S:
            fMoveUpDown -= 0.6;
            break;

        case Qt::Key_Left:
        case Qt::Key_Q:
            fMoveLeftRight -= 0.6;
            break;

        case Qt::Key_Right:
        case Qt::Key_D:
            fMoveLeftRight += 0.6;
            break;
        case Qt::Key_I:
            fRotationX += 10;
            break;
        case Qt::Key_K:
            fRotationX -= 10;
            break;
        case Qt::Key_J:
            fRotationY += 10;
            break;
        case Qt::Key_L:
            fRotationY -= 10;
            break;
        case Qt::Key_P:
            fRotationZ += 10;
            break;
        case Qt::Key_M:
            fRotationZ -= 10;
            break;
        default:
            QWindow::keyPressEvent( pEvent );
    }
    renderLater();
}
开发者ID:darwikey,项目名称:PFA-2D-3D,代码行数:60,代码来源:MyGLWidget.cpp


示例16: renderLater

void OpenGLWindow::setAnimating(bool animating)
{
    /*render() is called at the vertical refresh rate*/
    m_animating = animating;

    if (animating)
        renderLater();
}
开发者ID:gollabaer,项目名称:3DScanningLecture,代码行数:8,代码来源:mainwindow.cpp


示例17: qDebug

// Triggered when pressing any mouse button
void MainWindow::mousePressEvent(QMouseEvent *ev)
{
    qDebug() << "Mouse button pressed:" << ev->button();

    mouseClick =  ev->pos();

    renderLater();
}
开发者ID:DanielsWrath,项目名称:ComputerGraphics,代码行数:9,代码来源:mainwindow.cpp


示例18: renderLater

    void
    GLWindow::setAnimating(bool animating)
    {
      this->animating = animating;

      if (this->animating)
        renderLater();
    }
开发者ID:AlanRace,项目名称:bioformats,代码行数:8,代码来源:GLWindow.cpp


示例19: renderLater

void NGLScene::resizeEvent(QResizeEvent *_event )
{
  m_width=this->size().width();
  m_height=this->size().height();
  if(isExposed())
  {
    renderLater();
  }
}
开发者ID:NCCA,项目名称:NGL6Demos,代码行数:9,代码来源:NGLScene.cpp


示例20: renderLater

void NGLScene::timerEvent(QTimerEvent *_e)
{
  if(m_animate == true)
  {

     m_car->update();
    m_physics->step(1.0/60.0,10);
  }
  renderLater();

}
开发者ID:NCCA,项目名称:NGL6Demos,代码行数:11,代码来源:NGLScene.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ renderQuad函数代码示例发布时间:2022-05-30
下一篇:
C++ renderFrame函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap