Practical 4
Practical 4
h>
#include<iostream>
#include<math.h>
#include<GL/glut.h>
using namespace std;
int option=1;
struct Point
{
int x;
int y;
};
struct Color
{
float r,g,b;
};
void init()
{
glClearColor(0.0,0.0,0.0,0.0);
glColor3f(1.0,1.0,1.0);
glPointSize(1.0);
glMatrixMode(GL_PROJECTION);
gluOrtho2D(0,500,0,500);
}
if(option==1)
floodFill(x,500-y,oldColor,newColor);
else
boundryFill(x,500-y,fColor,bColor);
}
void display()
{
glClear(GL_COLOR_BUFFER_BIT);
glBegin(GL_LINE_LOOP);
glVertex2i(250,250);
glVertex2i(250,300);
glVertex2i(300,300);
glVertex2i(300,250);
glEnd();
glFlush();
}