void OpenGLHelpers::fillRectWithTexture (const Rectangle<int>& rect, GLuint textureID, const float alpha)
{
    glTexParameterf (GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
    glTexParameterf (GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
    glTexParameterf (GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
    glTexParameterf (GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
    glColor4f (alpha, alpha, alpha, alpha);

    drawTextureQuad (textureID, rect);
}
Example #2
0
void RestartButton::drawIcon( Vector3D *inCenter, double inRadius,
                              double inAlpha ) {

    // draw a green back arrow

    glColor4f( 0, 1, 0, inAlpha );

    // compensate for small radius of texture
    double drawRadius = inRadius / 0.6666;
    
    drawTextureQuad( mArrowTexture, inCenter, drawRadius );
    }
Example #3
0
void PauseButton::drawIcon( Vector3D *inCenter, double inRadius,
                              double inAlpha ) {

    // draw a yellow pause symbol 

    glColor4f( 1, 1, 0, inAlpha );

    // compensate for small radius of texture
    double drawRadius = inRadius / 0.6666;
    
    drawTextureQuad( mPauseTexture, inCenter, drawRadius );
    }
Example #4
0
void NextTutorialButton::drawIcon( Vector3D *inCenter, double inRadius,
                              double inAlpha ) {

    // draw a green back arrow

    glColor4f( 0, 1, 0, inAlpha );

    // compensate for small radius of texture
    double drawRadius = inRadius / 0.6666;

    // hack:  draw texture backwards using a negative radius
    drawTextureQuad( mArrowTexture, inCenter, -drawRadius );
    }