i need a program(code) for drawing using openGL.
example: when i click the left button of the mouse to start drawing something... and when i click the right button of the mouse to drop down a menu with colors, so i can choose a color to draw with...
I found something for the mouseHandler() that does the freehand drawing, and i tried to use it, but it's not working.
here is the func
void mouseHandler(int mouseX, int mouseY)
{
GLint x = mouseX;
GLint y = 640 - mouseY; //note mouse origin is bottom
GLint brushSize = 20;
glColor3f(1.0,0.0,0.0);
glRecti(x, y, x+brushSize, y+brushSize);
glFlush();
}
any help would be appreciated. thanks
|