Back to index

extremetuxracer  0.5beta
Functions
ppGL::draw Namespace Reference

Functions

void rect (pp::Color color, pp::Vec2d startPos, pp::Vec2d endPos)
void rect (const char *binding, pp::Vec2d pos, pp::Vec2d size)

Function Documentation

void ppGL::draw::rect ( pp::Color  color,
pp::Vec2d  startPos,
pp::Vec2d  endPos 
)

Definition at line 30 of file glhelper.cpp.

{
       glDisable( GL_TEXTURE_2D );
    glColor3dv( (double*)&color );
    glRectf( startPos.x, startPos.y,
               endPos.x,endPos.y );
       glEnable( GL_TEXTURE_2D );
}      

Here is the caller graph for this function:

void ppGL::draw::rect ( const char *  binding,
pp::Vec2d  pos,
pp::Vec2d  size 
)

Definition at line 40 of file glhelper.cpp.

{
       GLuint texobj;
       
    if ( !get_texture_binding( binding, &texobj ) ) {
              texobj = 0;
    }
              
    glPushMatrix();
    {  
              glBindTexture( GL_TEXTURE_2D, texobj );
              glEnable( GL_TEXTURE_2D );
              glColor4f( 1.0, 1.0, 1.0, 1.0 );
              glTranslatef( pos.x, pos.y, 0.0 );
              glBegin( GL_QUADS );
              {
              glTexCoord2f( 0.0, 0.0 );
              glVertex2f( 0.0, 0.0 );
           
              glTexCoord2f( 1.0, 0.0 );
                     glVertex2f( size.x, 0.0 );
           
              glTexCoord2f( 1.0, 1.0 );
              glVertex2f( size.x, size.y );
           
              glTexCoord2f( 0.0, 1.0 );
              glVertex2f( 0.0, size.y );
              }
              glEnd();
    }
    glPopMatrix();
}

Here is the call graph for this function: