Пример #1
0
//-----------------------------------------------------------------------------
// name: render()
// desc: ...
//-----------------------------------------------------------------------------
t_CKUINT ElciduaFace::render( void * data )
{
    scaleFont( 0.2, 1.2 );
    drawString_centered("devil ElCidua lived!");

    return TRUE;
}
Пример #2
0
//-----------------------------------------------------------------------------
// name: render()
// desc: ...
//-----------------------------------------------------------------------------
t_TAPUINT ElciduaFace::render( void * data )
{
    scaleFont( 0.2, 1.0 );
    drawString_centered("    Coming Soon!    ");

    return TRUE;
}
Пример #3
0
void
tree_Node_::drawTextRange(TextBuffer * b, int start, int end ) { 
    for ( int i = start; i <= end; i++ ) { 
//	    fprintf(stderr, "drawing %i\n", i);
        glTranslated( 0, -1.0, 0 );
        glPushMatrix();
        scaleFont( 1.0, 0.8 );
        drawString_mono( b->line(i-1).cstr() );
        glPopMatrix();
    }
}
Пример #4
0
//-----------------------------------------------------------------------------
// name: render_2()
// desc: ...
//-----------------------------------------------------------------------------
void AudicleFaceShredder::render_2( t_CKFLOAT delta )
{    
    Shred_Stat * stat = NULL;
    Shred_Data * data = NULL;
    Color4D c;
    Point3D p, v, a;
    Point3D b;
    t_CKFLOAT theta;
    static char buffer[2048];
    char * t;
    char * d;

    int i;
    
    // loop through
    t_CKFLOAT y = 1.15;
    for( i = 0; i < m_stats.size(); i++ )
    {
        stat = m_stats[i];
        data = (Shred_Data *)stat->data;
        data->pos2[1] = y;
        y -= .15;
    }

    // loop through
    Shred_Stat * s;
    t_CKFLOAT srate = Digitalio::sampling_rate() / 1000.0;
    for( i = 0; i < m_stats.size(); i++ )
    {    
        s = m_stats[i];
        data = m_stats[i]->data;
        c = data->color;
        p = data->pos2;

        switch( s->state )
        {
            case 0: t = "inactive"; break;
            case 1: t = "active"; break;
            case 2: t = "waiting"; break;
            case 3: t = "done"; break;
            default: t = "none"; break;
        }
        sprintf( buffer, "%i - %s - %s - %s - cycle(%i) - acts(%i) - c/a(%.2f) - avg(%.2fms)",
                 s->id, t, s->name.c_str(), s->source.c_str(), s->cycles, s->activations, s->average_cycles, s->average_ctrl / srate );

        // push the name
        glPushName( data->name );
        glPushMatrix();
        glColor4f( c[0], c[1], c[2], c[3] );
        glTranslatef( p[0], p[1], p[2] );
        glutSolidSphere( data->radius2, 15, 15 );
        glTranslatef( .1, -.033, 0.0 );
        glPushMatrix();
        glColor4f( 0.0, 0.0, 0.0, 1.0 );
        scaleFont( .052 );
        drawString( buffer );
        glPopMatrix();
        glPopMatrix();
        glPopName();
    }

    // loop through
    map<Shred_Stat *, Shred_Stat *>::iterator iter;
    for( iter = m_done.begin(); iter != m_done.end(); iter++ )
    {
        s = (*iter).second;
        data = (Shred_Data *)(*iter).second->data;
        c = data->color;
        data->pos2[1] = y;
        y -= .15;
        p = data->pos2;

        switch( s->state )
        {
            case 0: t = "inactive"; break;
            case 1: t = "active"; break;
            case 2: t = "waiting"; break;
            case 3: t = "done"; break;
            default: t = "none"; break;
        }
        sprintf( buffer, "%i - %s - %s - %s - cycle(%i) - acts(%i) - c/a(%.2f) - avg(%.2fms)",
                 s->id, t, s->name.c_str(), s->source.c_str(), s->cycles, s->activations, s->average_cycles, s->average_ctrl / srate );

        // push the name
        glPushName( data->name );
        glPushMatrix();
        glColor4f( c[0], c[1], c[2], c[3] );
        glTranslatef( p[0], p[1], p[2] );
        glutSolidSphere( data->radius2, 15, 15 );
        glTranslatef( .1, -.033, 0.0 );
        glPushMatrix();
        glDisable( GL_LIGHTING );
        glColor4f( 0.4, 0.4, 0.4, 1.0 );
        scaleFont( .052 );
        drawString( buffer );
        glEnable( GL_LIGHTING );
        glPopMatrix();
        glPopMatrix();
        glPopName();
    }
}
Пример #5
0
void
TextContent::draw() {
    
    _fixCanvas();
    _fixView();
    
    glPushMatrix();
    
    glPushMatrix();
    _viewport.setCols( UI_BASE, Color4D( 1.0,1.0,1.0, 0.8 ), Color4D(0.2, 0.5, 0.2, 0.8 ) );
    _viewport.viewTranslate();
    _viewport.filledQuad();
    glPopMatrix();
    
    _viewport.scale();
    _viewport.viewTranslate();
    
    glColor4d( 0,0,0,0.9);
    glLineWidth (2.0);

        
    if (_parse_tree) { 
        glPushMatrix();
        glScaled( _leading * 1.2 , -_leading, 0 ); //scale to match line positions
        glTranslated ( 1.0 , 0.0 ,0.0 );
        glColor4d ( 1,0,0,0.2 );
        _parse_tree->draw_tree();
        glPopMatrix();

        //glPushMatrix();
        //glTranslated( _leading * 5.0, 0, 0 );
        //glPushMatrix();
        //glScaled( _leading * 0.7 , _leading, 0 ); //scale to match line positions
        //_parse_tree->draw_tree_buffer(_buf);
        //glPopMatrix();
        //glPopMatrix();
    }
	
    glLineWidth ( ( _selected ) ? _fontWeight : _fontWeight );

    glTranslated( 0, _windowLinePos * -_leading, 0 ); //for all the lines we are skipping
    
    int n = min ( _windowLinePos + _windowLineSpan , _buf->nlines() );
    for  (int i = _windowLinePos ; i < n ; i++ ) { 
        glTranslated( 0, -_leading, 0 );
        
        glPushMatrix();
        scaleFont(_fontScale , _fontAspect );
        
        //
        if ( RenderMode == GL_RENDER &&  _markSpan.begin.line <= i && i <= _markSpan.end.line ) {  
            
            double x1,x2;
            
            x1 = 0;
            if ( i == _markSpan.begin.line ) 
                x1 = drawString_length(_buf->line(i).str().substr(0, _markSpan.begin.chr).c_str());
            
            
            if ( i == _markSpan.end.line )
                x2 = drawString_length(_buf->line(i).str().substr(0, _markSpan.end.chr).c_str());
            else 
                x2 = drawString_length(_buf->line(i).str().c_str());
            
            glColor4d( 0.0, 0.8, 0.8, 0.6 );
            glBegin(GL_QUADS);
            glVertex2d( x1-10 ,    -10 );
            glVertex2d( x2 + 10 , -10 );
            glVertex2d( x2 + 10 , 110 );
            glVertex2d( x1-10 ,    110 );
            glEnd();
        }
        
        if ( RenderMode == GL_RENDER &&  i == _loc.line ) { 
            
            //highlight span;
                    
            //highlight current line
            glColor4d( 0.8, 0.8, 0.0, 0.2 );
            double x = _canvas.w() * 100 * 200; //drawString_length(_lines[i].cstr());
            glBegin(GL_QUADS); 
            glVertex2d( -10 ,    -10 );
            glVertex2d( x + 10 , -10 );
            glVertex2d( x + 10 , 110 );
            glVertex2d( -10 ,    110 );
            glEnd();
            
            //draw cursor
            x = drawString_length(_buf->line(i).str().substr(0, _loc.chr).c_str());
            double x2 = drawString_length(_buf->line(i).str().substr(0, _loc.chr).c_str());
            glBegin(GL_LINES);
            
            glColor4d( 1.0 , 0.0, 0.0, 0.9 );
            
            glVertex2d ( x, -10 );
            glVertex2d ( x, 110 );
            glVertex2d ( x, -10 );
            glVertex2d ( x2, -10);
            
            glEnd();
            
        }   
        //draw the line
        glColor4d( 0,0,0,0.9);
        _buf->line(i).draw();
        glPopMatrix();
    }
    glPopMatrix();
}