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

C++ QGLFormat函数代码示例

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

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



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

示例1: QGLWidget

GLWidget::GLWidget(QWidget *parent)
: QGLWidget(QGLFormat(QGL::SampleBuffers), parent) {
	
	_mouseState = UP;
	
	
}
开发者ID:sesores,项目名称:cinderqt,代码行数:7,代码来源:glwidget.cpp


示例2: QGLWidget

//! [0]
GLWidgetShader::GLWidgetShader(QWidget *parent)
    : QGLWidget(QGLFormat(QGL::SampleBuffers), parent)
{
    glEnable(GL_MULTISAMPLE);

    // Important to enable the shaders
    QGLFormat rgbaformat;
    rgbaformat.setRgba(true);
    rgbaformat.setSampleBuffers(true);
    rgbaformat.setDoubleBuffer(true);
    rgbaformat.setSamples(4);
    rgbaformat.setOverlay(0);
    this->setFormat(rgbaformat);
    this->makeCurrent();
    // Very important
    this->setAutoFillBackground(false);

    QTimer *timer = new QTimer(this);
    timer->start(15);
    timer->setInterval(15);
    QObject::connect(timer,SIGNAL(timeout()),this,SLOT(repaint()));

    this->isDrawing=false;
    qglClearColor(Qt::white);
    this->nVertices = 0;
}
开发者ID:guendas,项目名称:cncsvision,代码行数:27,代码来源:GLWidgetShader.cpp


示例3: QGLWidget

GLWidget::GLWidget(QWidget *parent) :
    QGLWidget(QGLFormat(QGL::DoubleBuffer), parent) {
    this->setFocusPolicy(Qt::StrongFocus);
    this->setMouseTracking(true);
    this->setAutoBufferSwap(false);
    prev_fps_ = 0.f;
}
开发者ID:HobartReynolds,项目名称:cs123final,代码行数:7,代码来源:glwidget.cpp


示例4: QGLWidget

ModelViewGadgetWidget::ModelViewGadgetWidget(QWidget *parent)
    : QGLWidget(new GLC_Context(QGLFormat(QGL::SampleBuffers)), parent)
    , m_Light()
    , m_World()
    , m_GlView(this)
    , m_MoverController()
    , m_ModelBoundingBox()
    , m_MotionTimer()
    , acFilename()
    , bgFilename()
    , vboEnable(false)
{
    setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
    CreateScene();

    QColor repColor;
    repColor.setRgbF(1.0, 0.11372, 0.11372, 0.0);
    m_MoverController = GLC_Factory::instance()->createDefaultMoverController(repColor, &m_GlView);

    // Get required UAVObjects
    ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance();
    UAVObjectManager *objManager = pm->getObject<UAVObjectManager>();
    attActual = AttitudeActual::GetInstance(objManager);

    connect(&m_MotionTimer, SIGNAL(timeout()), this, SLOT(updateAttitude()));
}
开发者ID:MorS25,项目名称:OpenPilot,代码行数:26,代码来源:modelviewgadgetwidget.cpp


示例5: QGLWidget

UiRenderPreview::UiRenderPreview(QWidget *parent, void *shared) :
    QGLWidget(QGLFormat(QGL::DoubleBuffer | QGL::DirectRendering), parent, (QGLWidget*)shared) {
#else
UiRenderPreview::UiRenderPreview(QWidget *parent, void *shared) :
    QOpenGLWidget(parent) {
    Q_UNUSED(shared);
    QSurfaceFormat sf;
    //sf.setProfile(QSurfaceFormat::CompatibilityProfile);
    //sf.setRenderableType(QSurfaceFormat::OpenGL);
    //sf.setSwapBehavior(QSurfaceFormat::DoubleBuffer);
    //sf.setOption(QSurfaceFormat::DeprecatedFunctions);
    sf.setSamples(4./devicePixelRatioFScale());
    setFormat(sf);
#endif
    setFocusPolicy(Qt::StrongFocus);
    render = 0;
}

void UiRenderPreview::initializeGL() {
    //OpenGL options
}

void UiRenderPreview::resizeGL(int width, int height) {
    glViewport(0, 0, (GLint)width, (GLint)height);
    glMatrixMode(GL_PROJECTION);
    glLoadIdentity();
    glOrtho(0, 1, 0, 1, 1, -1);
    glMatrixMode(GL_MODELVIEW);
    glLoadIdentity();
}
开发者ID:iannix,项目名称:IanniX,代码行数:30,代码来源:uirenderpreview.cpp


示例6: QGLWidget

GlWidget::GlWidget(QWidget *parent)
    :   QGLWidget(QGLFormat(/* Additional format options */), parent)
{
    alpha = 25;
    beta = -25;
    distance = 2.5;
}
开发者ID:s0dz,项目名称:playingWithOpenGL,代码行数:7,代码来源:glwidget.cpp


示例7: QGLWidget

OpenGLWidget::OpenGLWidget(QWidget *parent) : QGLWidget(QGLFormat(QGL::SampleBuffers), parent)
{
    m_clearColor = QColor::fromRgb(0, 0, 0, 0);
    m_glContext = nullptr;
    m_width = 0;
    m_height = 0;
}
开发者ID:karpinsn,项目名称:SLS,代码行数:7,代码来源:OpenGLWidget.cpp


示例8: QGLWidget

MyGLWidget::MyGLWidget(QWidget *parent)
    : QGLWidget(QGLFormat(QGL::SampleBuffers), parent)
{
    xRot = 0;
    yRot = 0;
    zRot = 0;
}
开发者ID:a7medfahmy94,项目名称:GraphicsOpenGL,代码行数:7,代码来源:myglwidget.cpp


示例9: QGLWidget

// ...
GLWidget::GLWidget(QWidget* parent) : QGLWidget(QGLFormat(QGL::DoubleBuffer | QGL::Rgba | QGL::DepthBuffer), parent)
{
	makeCurrent();
	initFont();
	resetSelection();

}
开发者ID:hunhuang,项目名称:codeblock,代码行数:8,代码来源:glwidget.cpp


示例10: QGLWidget

GLQuad::GLQuad(QWidget *parent)
   : QGLWidget(QGLFormat(QGL::SampleBuffers), parent)
{
   QTimer *timer = new QTimer(this);
   connect( timer, SIGNAL(timeout()), this, SLOT(updateGL()) );
   timer->start( 50 );
}
开发者ID:dwsaxton,项目名称:quad,代码行数:7,代码来源:glquad.cpp


示例11: QGLWidget

GLWidget::GLWidget(QWidget *p_parent)
    : QGLWidget(new QGLContext(QGLFormat(QGL::SampleBuffers)), p_parent)
    , m_Light()
    , m_World()
    , m_GlView()
    , m_MoverController()
    , m_ShuttleBoundingBox()
    , m_MotionTimer()
{
    connect(&m_GlView, SIGNAL(updateOpenGL()), this, SLOT(updateGL()));

    m_Light.setPosition(4000.0, 40000.0, 80000.0);
    //m_GlView.setBackgroundColor(Qt::white);
    m_Light.setAmbientColor(Qt::lightGray);

    m_GlView.cameraHandle()->setDefaultUpVector(glc::Z_AXIS);
    m_GlView.cameraHandle()->setIsoView();

    QColor repColor;
    repColor.setRgbF(1.0, 0.11372, 0.11372, 1.0);
    m_MoverController= GLC_Factory::instance()->createDefaultMoverController(repColor, &m_GlView);

    createScene();
    // Signal and slot connection
    connect(&m_MotionTimer, SIGNAL(timeout()), this, SLOT(rotateView()));

    qDebug() << glc::X_AXIS.signedAngleWithVect(-glc::Y_AXIS, glc::Z_AXIS);
    qDebug() << fmod(glc::X_AXIS.signedAngleWithVect(-glc::Y_AXIS, glc::Z_AXIS), 2.0 * glc::PI);
}
开发者ID:JasonWinston,项目名称:GLC_lib,代码行数:29,代码来源:glwidget.cpp


示例12: setViewport

void CSceneWidget::setEnabledOpenGl(bool enable)
{
#ifndef QT_NO_OPENGL
    if(QGLFormat::hasOpenGL())
        setViewport(enable?new QGLWidget(QGLFormat(QGL::SampleBuffers | QGL::DirectRendering)):new QWidget);
#endif
}
开发者ID:slima4,项目名称:zgui-qt,代码行数:7,代码来源:scenewidget.cpp


示例13: QGLWidget

GLWidget::GLWidget(QWidget *parent)
    : QGLWidget(QGLFormat(QGL::SampleBuffers), parent)
{
    resize(800,800);

    QString filename = qApp->arguments().value(1,"");
    qDebug() << "arglength: " << qApp->arguments().length();
    if (filename == "artificial" || qApp->arguments().length() == 1) {
        qDebug() << "creating new artificial data";
        cons = new ArtificialConnections();

    } else if (arg("nodes")!=""){
        qDebug() << arg("nodes");
        cons = new Connections(arg("nodes"), arg("cons"));
    } else {
        qDebug() << filename;
        cons = new Connections(filename);
    }

    view = new GLfloat[16];
    stuffAlpha = 0.99;
    QVector3D size = cons->max-cons->min;
    float largest = qMax(size.x(),size.y());
    scale = (1/largest)*0.95;
    bg = 1;
    p1 = true;
    p2 = true;

    if (qApp->arguments().indexOf(QRegExp("-writefib"))!=-1) cons->writeBinaryVTK(filename+".fib");

    if (qApp->arguments().indexOf(QRegExp("-screenshot"))!=-1) screenshot(filename+".png");
    if (qApp->arguments().indexOf(QRegExp("-csv"))!=-1) cons->writeCSVs();
    setFocus();

}
开发者ID:satra,项目名称:brainbundler,代码行数:35,代码来源:glwidget.cpp


示例14: QGraphicsView

SchemaEditor::SchemaEditor(QWidget *parent, SchemaGui *schemaGui, Engine * engine, PanelScrollView *panelScrollView) :
  QGraphicsView(schemaGui, parent),
  _contextMenuPos(0,0),
  _contextGear(NULL),
  _engine(engine),
  _schemaGui(schemaGui),
  _scale(1),
  _panelScrollView(panelScrollView),
  _maxZValue(1),
  _selectionChangeBypass(false)
  

{
  _schemaGui->setSchemaEditor(this);
  setDragMode(QGraphicsView::RubberBandDrag);
  setRenderHint(QPainter::Antialiasing, true);

  setFrameStyle(Sunken | StyledPanel);
  setOptimizationFlags(QGraphicsView::DontSavePainterState | QGraphicsView::IndirectPainting);
  setViewportUpdateMode(QGraphicsView::FullViewportUpdate);
  setTransformationAnchor(QGraphicsView::AnchorUnderMouse);
  
  // render with OpenGL
  if(0)
    setViewport(new QGLWidget(QGLFormat(QGL::SampleBuffers)));

  resetTransform();
  setAcceptDrops(TRUE);
}
开发者ID:jukea,项目名称:drone,代码行数:29,代码来源:SchemaEditor.cpp


示例15: QMainWindow

MainWindow::MainWindow() : QMainWindow(0)
{
    QMenu *file = menuBar()->addMenu(tr("&File"));

    QAction *newAction = file->addAction(tr("New Game"));
    newAction->setShortcut(QKeySequence(Qt::CTRL | Qt::Key_N));
    QAction *quitAction = file->addAction(tr("Quit"));
    quitAction->setShortcut(QKeySequence(Qt::CTRL | Qt::Key_Q));

    if (QApplication::arguments().contains("-fullscreen")) {
        scene = new GraphicsScene(0, 0, 750, 400, GraphicsScene::Small);
        setWindowState(Qt::WindowFullScreen);
    } else {
        scene = new GraphicsScene(0, 0, 880, 630);
        layout()->setSizeConstraint(QLayout::SetFixedSize);
    }

    view = new QGraphicsView(scene, this);
    view->setAlignment(Qt::AlignLeft | Qt::AlignTop);
    scene->setupScene(newAction, quitAction);
#ifndef QT_NO_OPENGL
    view->setViewport(new QGLWidget(QGLFormat(QGL::SampleBuffers)));
#endif

    setCentralWidget(view);
}
开发者ID:elProxy,项目名称:qtbase,代码行数:26,代码来源:mainwindow.cpp


示例16: main

int main(int argc, char *argv[]) {
  QApplication app(argc, argv);
  GLWindow *window = new GLWindow(QGLFormat());
  window->show();

  return app.exec();
}
开发者ID:otaviog,项目名称:UdToolkit,代码行数:7,代码来源:main.cpp


示例17: QGLWidget

//constructor
GlWidget::GlWidget(QWidget *parent)
    : QGLWidget(parent)
{
    theta=90;
    phi=90;
    r=20;
    eyeX=0;
    eyeY=0;
    eyeZ=r;

    upX=0;
    upY=1;
    upZ=0;
    sizeX=20;
    sizeY=20;
    zoom = 2.5;
    xMove = 0;
    yMove = 0;
    currentLayer=0;
    layers = 5000;
    show_travel=false;
    qtGreen = QColor::fromCmykF(0.40, 0.0, 1.0, 0.0);
    qtPurple = QColor::fromCmykF(0.39, 0.39, 0.0, 0.0);
    this->setFormat(QGLFormat(QGL::SampleBuffers));
}
开发者ID:PeterS242,项目名称:YARRH,代码行数:26,代码来源:glwidget.cpp


示例18: QGLWidget

ModelViewGadgetWidget::ModelViewGadgetWidget(QWidget *parent)
    : QGLWidget(new GLC_Context(QGLFormat(QGL::SampleBuffers)), parent)
    , m_Light()
    , m_World()
    , m_GlView()
    , m_MoverController()
    , m_ModelBoundingBox()
    , m_MotionTimer()
    , acFilename()
    , bgFilename()
    , vboEnable(false)
{
    connect(&m_GlView, SIGNAL(updateOpenGL()), this, SLOT(updateGL()));
    setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);

    m_Light.setPosition(4000.0, 40000.0, 80000.0);
    // m_GlView.setBackgroundColor(Qt::white);
    m_Light.setAmbientColor(Qt::lightGray);

    m_GlView.cameraHandle()->setDefaultUpVector(glc::Z_AXIS);
    m_GlView.cameraHandle()->setRearView();

    QColor repColor;
    repColor.setRgbF(1.0, 0.11372, 0.11372, 0.0);
    m_MoverController = GLC_Factory::instance()->createDefaultMoverController(repColor, &m_GlView);

    CreateScene();
    // Get required UAVObjects
    ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance();
    UAVObjectManager *objManager = pm->getObject<UAVObjectManager>();
    attState = AttitudeActual::GetInstance(objManager);

    connect(&m_MotionTimer, SIGNAL(timeout()), this, SLOT(updateAttitude()));
}
开发者ID:EvalZero,项目名称:TauLabs,代码行数:34,代码来源:modelviewgadgetwidget.cpp


示例19: QGLWidget

LifeWidget::LifeWidget(LifePlugin *plug, QWidget *parent) : QGLWidget(parent), curPlugin(plug), curIter(0) {
    setFormat(QGLFormat(QGL::DoubleBuffer | QGL::DepthBuffer // | QGL::SampleBuffers
                        | QGL::AlphaChannel | QGL::DirectRendering));

    connect(&timer, SIGNAL(timeout()), this, SLOT(timeout()));

}
开发者ID:jl2,项目名称:LifeAutomata,代码行数:7,代码来源:lifewidget.cpp


示例20: QGLWidget

GLWidget3D::GLWidget3D(MainWindow* mainWin) : QGLWidget(QGLFormat(QGL::SampleBuffers), (QWidget*)mainWin) {
	this->mainWin = mainWin;

	camera2D.resetCamera();
	camera3D.resetCamera();
	camera = &camera2D;
	//G::global()["rend_mode"]=0;//2D	setRender2D_3D();

	spaceRadius=30000.0;
	farPlaneToSpaceRadiusFactor=5.0f;//N 5.0f

	rotationSensitivity = 0.4f;
	zoomSensitivity = 10.0f;

	controlPressed=false;
	shiftPressed=false;
	altPressed=false;
	keyMPressed=false;

	camera->setRotation(0, 0, 0);
	camera->setTranslation(0, 0, G::getFloat("MAX_Z"));//6000);

	vertexSelected = false;
	edgeSelected = false;

	shadowEnabled=true;
}
开发者ID:gnishida,项目名称:CityDesigner,代码行数:27,代码来源:GLWidget3D.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ QGeoCoordinate函数代码示例发布时间:2022-05-30
下一篇:
C++ QFontMetricsF函数代码示例发布时间: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