openGL - freehand drawing

openGL - freehand drawing

offline
  • Pridružio: 30 Sep 2006
  • Poruke: 137

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



Registruj se da bi učestvovao u diskusiji. Registrovanim korisnicima se NE prikazuju reklame unutar poruka.
Ko je trenutno na forumu
 

Ukupno su 492 korisnika na forumu :: 3 registrovanih, 1 sakriven i 488 gosta   ::   [ Administrator ] [ Supermoderator ] [ Moderator ] :: Detaljnije

Najviše korisnika na forumu ikad bilo je 3466 - dana 01 Jun 2021 17:07

Korisnici koji su trenutno na forumu:
Korisnici trenutno na forumu: S1Mk3, sasa76, Shilok