RenderWidget::RenderWidget(QWidget *parent) : QOpenGLWidget(parent), renderFunctions(nullptr), render(nullptr), quad(nullptr), quadShader(nullptr), openglDebugLogger(nullptr), captureMouse(false), onlyShowTexture(false), textureDisplayed(color) { // Widget config setUpdateBehavior(QOpenGLWidget::NoPartialUpdate); setFocusPolicy(Qt::ClickFocus); // Update Timer config connect(&updateTimer, SIGNAL(timeout()), this, SLOT(update())); startUpdateLoop(); // Open GL Context config QSurfaceFormat f; f.setRenderableType(QSurfaceFormat::OpenGL); f.setMajorVersion(4); f.setMinorVersion(5); f.setProfile(QSurfaceFormat::CoreProfile); f.setOptions(QSurfaceFormat::DebugContext | f.options()); setFormat(f); }
QtGLWidget::QtGLWidget(ofAppQtWindow* _windowPtr){ qt_set_sequence_auto_mnemonic(true); mousePressed = 0; setMouseTracking(true); setUpdateBehavior(QOpenGLWidget::PartialUpdate); // very important // ofAppPtr = _ofAppPtr; instance = _windowPtr; }
PvGLWidget::PvGLWidget(QWidget *parent, int ident, int *socket, const char *name) : QOpenGLWidget(parent) , QOpenGLFunctions() { if(gldebug) printf("construct 1\n"); id = ident; s = socket; minobject = maxobject = -1; if(name != NULL) setObjectName(name); app_init_open_gl(); setUpdateBehavior(QOpenGLWidget::PartialUpdate); if(gldebug) printf("construct end\n"); }
ConnectorParameter::ConnectorParameter(const ConnectorDescription* const connector, const UpdateBehavior behavior) : Parameter(connector->id(), connector->variant()), m_connector(connector) { setTitle(connector->title()); setVisualization(connector->visualization()); setUpdateBehavior(behavior); switch (connector->originalType()) { case Description::INPUT: setAccessMode(ACTIVATED_WRITE); break; case Description::OUTPUT: setAccessMode(INITIALIZED_READ); break; default: throw InternalError("A connector parameter can only be created from inputs or outputs"); } }