/******************************************************************** File: gradient.cc Author: Dana Vrajitoru Project: Simple gradient program Last updated: January 9, 2017. Drawing several gradients using simple lines. ********************************************************************/ #include #include "gradient.h" // display a vertical gradient going from the bg color on the left to // the fg color on the right void verticalGrad(float bg[], float fg[], float start[], float end[]) { glBegin(GL_POLYGON); glColor3f(bg[0], bg[1], bg[2]); glVertex2f(start[0], start[1]); // bottom left glColor3f(fg[0], fg[1], fg[2]); glVertex2f(end[0], start[1]); // bottom right glVertex2f(end[0], end[1]); // top right glColor3f(bg[0], bg[1], bg[2]); glVertex2f(start[0], end[1]); // top left glEnd(); } // display a vertical gradient made of horizontal lines of varying color void verticalGrad1(float bg[], float fg[], float start[], float end[]) { int i; float y, color[3], alpha; for (y=start[1]; y