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); }
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 ); }
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 ); }
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 ); }