void ParticleTrace :: draw ( bool bUpdated ) { if( !bImageLoaded ) return; ofEnableAlphaBlending(); //---- glPushMatrix(); glTranslatef( imgRectCurrent.x, imgRectCurrent.y, 0 ); drawSourceImage(); drawToTraceImage( bUpdated ); drawTraceImage(); drawParticles( bUpdated ); glPopMatrix(); //---- drawRectOutline( activeRect ); drawRectOutline( imgRectCurrent ); drawSamples(); }
// Draw the control. void Slider::draw(void) { // Draw the background. drawBackground(); // Draw the thumb. if(!(isClear(m_thumbColor) && isClear(m_thumbOutlineColor))) { float relativePosition = 0.0; if(m_maxValue != m_minValue) { relativePosition = ((float)(m_position-m_minValue)) / (m_maxValue-m_minValue); } Rect thumbRect = m_rect; if(m_vertical) { // Vertical thumb. thumbRect.size.height = m_thumbLength * m_rect.size.height; thumbRect.origin.y += (1.0 - relativePosition) * (m_rect.size.height-thumbRect.size.height); } else { // Horizontal thumb. thumbRect.size.width = m_thumbLength * m_rect.size.width; thumbRect.origin.x += relativePosition * (m_rect.size.width-thumbRect.size.width); } m_thumbRect = thumbRect; // Want to save away the bigger version for mouse hits. thumbRect.inset(Size(.01,.01)); drawRect(thumbRect, m_thumbColor); drawRectOutline(thumbRect, m_thumbOutlineColor, 1.0); } }
//Draw window background. void Window::drawBackground( void ) { m_texture.draw( m_rect ); if ( !isClear( m_color ) ) drawRect( m_rect, m_color ); if ( !isClear( m_outlineColor ) ) drawRectOutline( m_rect, m_outlineColor, m_outlineWidth ); }