void PopupMenu::render(void) { glMatrixMode(GL_MODELVIEW); glPushMatrix(); glTranslatef(position.getX(), position.getY(), 0.0f); saveTransform(); glPushAttrib(GL_LINE_BIT | GL_CURRENT_BIT); glLineWidth(1.0f); if(dirty) { glNewList(displayList, GL_COMPILE); renderBackgroundMask(); glColor4f(1.0f, 1.0f, 1.0f, LINE_OPACITY); glBegin(GL_LINE_STRIP); glVertex3f(width, BAR_DIM, 0.0f); glVertex3f(width, height, 0.0f); glVertex3f(0.0f, height, 0.0f); glVertex3f(0.0f, BAR_DIM, 0.0f); glEnd(); glEndList(); } glCallList(displayList); renderInterfaceElements(); glPopAttrib(); glPopMatrix(); }
static void transformops_exit(bContext *C, wmOperator *op) { saveTransform(C, op->customdata, op); MEM_freeN(op->customdata); op->customdata = NULL; G.moving = 0; }
void MainControlPanel::render(void) { glMatrixMode(GL_MODELVIEW); glPushMatrix(); glTranslatef(position.getX(), position.getY(), 0.0f); saveTransform(); glPushAttrib(GL_LINE_BIT | GL_CURRENT_BIT); glLineWidth(0.75f); if(dirty) { glNewList(displayList, GL_COMPILE); renderBackgroundMask(); glColor4f(1.0f, 1.0f, 1.0f, 1.0f); glBegin(GL_LINE_LOOP); glVertex3f(0.0, 0.0f, 0.0f); glVertex3f(width, 0.0f, 0.0f); glVertex3f(width, height, 0.0f); glVertex3f(0.0f, height, 0.0f); glEnd(); glEndList(); dirty = false; } glCallList(displayList); renderInterfaceElements(); glPopAttrib(); glPopMatrix(); }
void GridScrollMenu::render(void) { glMatrixMode(GL_MODELVIEW); glPushMatrix(); glTranslatef(position.getX(), position.getY(), 0.0f); saveTransform(); glLineWidth(1.0f); if(dirty) { glNewList(displayList, GL_COMPILE); glColor4f(1.0f, 1.0f, 1.0f, LINE_OPACITY); glBegin(GL_LINE_LOOP); glVertex3f(0.0f, 0.0f, 0.0f); glVertex3f(width, 0.0f, 0.0f); //Modded 14th glVertex3f(width, height, 0.0f);//Modded 14th glVertex3f(0.0f, height, 0.0f); glEnd(); renderScrollBar(); glEndList(); dirty = false; } glCallList(displayList); renderInterfaceElements(); glPopMatrix(); }
void FFTSplineControl::render(void) { SplineControl::render(); glMatrixMode(GL_MODELVIEW); glPushMatrix(); glTranslatef(position.getX(), position.getY(), 0.0f); saveTransform(); glPushAttrib(GL_CURRENT_BIT | GL_LINE_BIT); if(fftDirty) { glNewList(fftDisplayList, GL_COMPILE); glEndList(); fftDirty = false; } glCallList(fftDisplayList); // no display list for FFT as it is always changing renderFFT(); glPopAttrib(); glPopMatrix(); }
void ExternalVisualScrollMenu::render(void) { glMatrixMode(GL_MODELVIEW); glPushMatrix(); glTranslatef(position.getX(), position.getY(), 0.0f); saveTransform(); if(displayList) { glNewList(displayList, GL_COMPILE); glPushAttrib(GL_LINE_BIT | GL_CURRENT_BIT); glLineWidth(1.0f); glColor4f(1.0f, 1.0f, 1.0f, LINE_OPACITY); glBegin(GL_LINE_LOOP); glVertex3f(0.0f, 0.0f, 0.0f); glVertex3f(width, 0.0f, 0.0f); glVertex3f(width, height, 0.0f); glVertex3f(0.0f, height, 0.0f); glEnd(); glPopAttrib(); glEndList(); dirty = false; } glCallList(displayList); renderInterfaceElements(); glPopMatrix(); }
static void transformops_exit(bContext *C, wmOperator *op) { #ifdef USE_LOOPSLIDE_HACK transformops_loopsel_hack(C, op); #endif saveTransform(C, op->customdata, op); MEM_freeN(op->customdata); op->customdata = NULL; G.moving = 0; }
void Track::render(void) { glMatrixMode(GL_MODELVIEW); glPushMatrix(); glTranslatef(position.getX(), position.getY(), 0.0f); saveTransform(); renderInterfaceElements(); glPopMatrix(); }
/* PUBLIC MEMBER FUNCTIONS */ void CueButton::render(void) { Button::render(); glMatrixMode(GL_MODELVIEW); glPushMatrix(); glTranslatef(position.getX(), position.getY(), 0.0f); saveTransform(); glPushAttrib(GL_CURRENT_BIT | GL_LINE_BIT); glLineWidth(getLineWidth(ICON_LINE_WIDTH)); if(cueButtonDirty) { glNewList(cueButtonDisplayList, GL_COMPILE); // box glLineWidth(1.0f); glEnable(GL_LINE_SMOOTH); for(unsigned int i = 0; i < 2; i++) { float renderOpacity = (i == 0) ? 1.0f : 1.0f; glColor4f(1.0f, 1.0f, 1.0f, renderOpacity); GLenum renderMode = (i == 0) ? GL_QUADS : GL_LINE_LOOP; glBegin(renderMode); glVertex3f(width * 0.4f, height * 0.7f, 0.0f); glVertex3f(width * 0.8f, height * 0.7f, 0.0f); glVertex3f(width * 0.8f, height * 0.3f, 0.0f); glVertex3f(width * 0.4f, height * 0.3f, 0.0f); glEnd(); renderMode = (i == 0) ? GL_TRIANGLES : GL_LINE_LOOP; glBegin(renderMode); glVertex3f(width * 0.2f, height * 0.7f, 0.0f); glVertex3f(width * 0.4f, height * 0.5f, 0.0f); glVertex3f(width * 0.2f, height * 0.3f, 0.0f); glEnd(); } glDisable(GL_LINE_SMOOTH); glEndList(); cueButtonDirty = false; } glCallList(cueButtonDisplayList); glPopAttrib(); glPopMatrix(); }
void ControlPoint::render(void) { glMatrixMode(GL_MODELVIEW); glPushMatrix(); glTranslatef(position.getX(), position.getY(), 0.0f); saveTransform(); float scale = width; glScalef(scale, scale, scale); glPushAttrib(GL_LINE_BIT | GL_CURRENT_BIT); if(dirty) { glNewList(displayList, GL_COMPILE); glLineWidth(1.0f); glColor4f(1.0f, 1.0f, 1.0f, 1.0f); if(!inside) { glColor4f(1.0f, 1.0f, 1.0f, OUTSIDE_OPACITY); } glBegin(GL_LINES); glVertex3f(CROSS_DIM, -CROSS_DIM, 0.0f); glVertex3f(-CROSS_DIM, CROSS_DIM, 0.0f); glVertex3f(CROSS_DIM, CROSS_DIM, 0.0f); glVertex3f(-CROSS_DIM, -CROSS_DIM, 0.0f); glEnd(); glEndList(); } glCallList(displayList); glPopAttrib(); glPopMatrix(); }
/* PUBLIC MEMBER FUNCTIONS */ void TapButton::render(void) { Button::render(); glMatrixMode(GL_MODELVIEW); glPushMatrix(); glTranslatef(position.getX(), position.getY(), 0.0f); saveTransform(); glPushAttrib(GL_CURRENT_BIT | GL_LINE_BIT); glLineWidth(1.0f); glColor4f(1.0f, 1.0f, 1.0f, 1.0f); if(tapButtonDirty) { glNewList(tapButtonDisplayList, GL_COMPILE); float textHeight = height * 0.15f; float x = (width / 2.0f) - ((textHeight * tapText.size()) / 2.0f); float y = (height / 2.0f) - (textHeight / 2.0f); glTranslatef(x, y, 0.0f); GLContext *currContext = GLContext::getCurrentContext(); assert(currContext != NULL); currContext->renderString(tapText, Vector2f(textHeight * tapText.size(), textHeight)); glEndList(); tapButtonDirty = false; } glCallList(tapButtonDisplayList); glPopAttrib(); glPopMatrix(); }
void PopupMenuItem::render(void) { glMatrixMode(GL_MODELVIEW); glPushMatrix(); glTranslatef(position.getX(), position.getY(), 0.0f); saveTransform(); glPushAttrib(GL_CURRENT_BIT); if(dirty) { glNewList(popupMenuItemDisplayList, GL_COMPILE); if(selected) { glPolygonOffset(1.0f, 1.0f); glColor4f(1.0f, 1.0f, 1.0f, SELECTED_OPACITY); glBegin(GL_POLYGON); glVertex3f(0.0f, 0.0f, 0.0f); glVertex3f(width, 0.0f, 0.0f); glVertex3f(width, height, 0.0f); glVertex3f(0.0f, height, 0.0f); glEnd(); } glEndList(); dirty = false; } glCallList(popupMenuItemDisplayList); glPopAttrib(); glPopMatrix(); }
void SplineControl::render(void) { glMatrixMode(GL_MODELVIEW); glPushMatrix(); glTranslatef(position.getX(), position.getY(), 0.0f); saveTransform(); glPushAttrib(GL_CURRENT_BIT | GL_LINE_BIT); glLineWidth(1.0f); if(dirty) { glNewList(displayList, GL_COMPILE); renderBackgroundMask(); glColor4f(1.0f, 1.0f, 1.0f, LINE_OPACITY); glBegin(GL_LINE_LOOP); glVertex3f(0.0f, 0.0f, 0.0f); glVertex3f(width, 0.0f, 0.0f); glVertex3f(width, height, 0.0f); glVertex3f(0.0f, height, 0.0f); glEnd(); glColor4f(1.0f, 1.0f, 1.0f, 0.33f); // centre line glBegin(GL_LINE_STRIP); glVertex3f(0.0f, height / 2.0f, 0.0f); glVertex3f(width, height / 2.0f, 0.0f); glEnd(); float legendDim = height * LEGEND_DIM; // divisions for(unsigned int i = 0; i < InterfaceManager::BEATS; i++) { float pos = InterfaceManager::getBeatLength() * (float)i; if(pos > width) { break; } else { glBegin(GL_LINE_STRIP); glVertex3f(pos, legendDim, 0.0f); glVertex3f(pos, height - legendDim, 0.0f); glEnd(); } } // legends glColor4f(1.0f, 1.0f, 1.0f, LINE_OPACITY); glBegin(GL_LINES); glVertex3f(0.0f, legendDim, 0.0f); glVertex3f(width, legendDim, 0.0f); glVertex3f(0.0f, height - legendDim, 0.0f); glVertex3f(width, height - legendDim, 0.0f); glEnd(); float xIncrement = InterfaceManager::getBeatLength() / (float)LEGEND_BEAT_SUBDIVISIONS; for(unsigned int i = 0; xIncrement * (float)i < width; i++) { float lineLength = legendDim; if((i % LEGEND_BEAT_SUBDIVISIONS) != 0) { lineLength *= LEGEND_SUBBEAT_DIM; } glBegin(GL_LINES); // top glVertex3f(xIncrement * i, legendDim, 0.0f); glVertex3f(xIncrement * i, legendDim - lineLength, 0.0f); // bottom glVertex3f(xIncrement * i, height - legendDim, 0.0f); glVertex3f(xIncrement * i, (height - legendDim) + lineLength, 0.0f); glEnd(); } glEndList(); dirty = false; } glCallList(displayList); glLineWidth(getLineWidth(1.0f)); if(splineDirty) { glNewList(splineDisplayList, GL_COMPILE); renderSplineControl(width); glEndList(); splineDirty = false; } glCallList(splineDisplayList); renderInterfaceElements(); glPopAttrib(); glPopMatrix(); }
void FingerHeldCursor::render(void) { assert(modelview != NULL); glMatrixMode(GL_MODELVIEW); glPushMatrix(); glTranslatef(position.getX(), position.getY(), 0.0f); saveTransform(); glLineWidth(1.0f); if(dirty) { glNewList(displayList, GL_COMPILE); float scale = modelview->getXScale(); float radius = (width / 4.0f) / scale; float iRadius = radius * INNER_RAD; unsigned int elapsedTime = currentTime - resetTime; float progress = (float)elapsedTime / (float)period; float increment = 1.0f / (float)CIRCLE_SEGS; glColor4f(1.0f, 1.0f, 1.0f, 0.9f); glBegin(GL_TRIANGLE_STRIP); for(float f = 0; f < progress; f += increment) { float theta = (2.0f * M_PI) * f; float x = cos(theta) * radius; float y = sin(theta) * radius; float ix = cos(theta) * iRadius; float iy = sin(theta) * iRadius; glVertex3f(x, y, 0.0f); glVertex3f(ix, iy, 0.0f); } glEnd(); glEnable(GL_LINE_SMOOTH); glBegin(GL_LINE_STRIP); for(float f = 0; f < progress; f += increment) { float theta = (2.0f * M_PI) * f; float x = cos(theta) * radius; float y = sin(theta) * radius; glVertex3f(x, y, 0.0f); } glEnd(); glBegin(GL_LINE_STRIP); for(float f = 0; f < progress; f += increment) { float theta = (2.0f * M_PI) * f; float ix = cos(theta) * iRadius; float iy = sin(theta) * iRadius; glVertex3f(ix, iy, 0.0f); } glEnd(); glDisable(GL_LINE_SMOOTH); glEndList(); dirty = false; } glCallList(displayList); glPopMatrix(); }
/* PUBLIC MEMBER FUNCTIONS */ void FFTButton::render(void) { Button::render(); glMatrixMode(GL_MODELVIEW); glPushMatrix(); glTranslatef(position.getX(), position.getY(), 0.0f); saveTransform(); glPushAttrib(GL_CURRENT_BIT | GL_LINE_BIT); glLineWidth(1.0f); if(fftButtonDirty) { glNewList(fftButtonDisplayList, GL_COMPILE); glColor4f(1.0f, 1.0f, 1.0f, 1.0f); glBegin(GL_LINE_LOOP); // bar 1 glVertex3f(width * 0.15f, height * 0.2f, 0.0f); glVertex3f(width * 0.15f, height * 0.8f, 0.0f); glVertex3f(width * 0.25f, height * 0.8f, 0.0f); glVertex3f(width * 0.25f, height * 0.2f, 0.0f); glEnd(); glBegin(GL_LINE_LOOP); // bar 2 glVertex3f(width * 0.3f, height * 0.5f, 0.0f); glVertex3f(width * 0.3f, height * 0.8f, 0.0f); glVertex3f(width * 0.4f, height * 0.8f, 0.0f); glVertex3f(width * 0.4f, height * 0.5f, 0.0f); glEnd(); glBegin(GL_LINE_LOOP); // bar 3 glVertex3f(width * 0.45f, height * 0.55f, 0.0f); glVertex3f(width * 0.45f, height * 0.8f, 0.0f); glVertex3f(width * 0.55f, height * 0.8f, 0.0f); glVertex3f(width * 0.55f, height * 0.55f, 0.0f); glEnd(); glBegin(GL_LINE_LOOP); // bar 5 glVertex3f(width * 0.6f, height * 0.33f, 0.0f); glVertex3f(width * 0.6f, height * 0.8f, 0.0f); glVertex3f(width * 0.7f, height * 0.8f, 0.0f); glVertex3f(width * 0.7f, height * 0.33f, 0.0f); glEnd(); glBegin(GL_LINE_LOOP); // bar 5 glVertex3f(width * 0.75f, height * 0.65f, 0.0f); glVertex3f(width * 0.75f, height * 0.8f, 0.0f); glVertex3f(width * 0.85f, height * 0.8f, 0.0f); glVertex3f(width * 0.85f, height * 0.65f, 0.0f); glEnd(); glEndList(); fftButtonDirty = false; } glCallList(fftButtonDisplayList); glPopAttrib(); glPopMatrix(); }