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 2857 korisnika na forumu :: 78 registrovanih, 6 sakrivenih i 2773 gosta   ::   [ Administrator ] [ Supermoderator ] [ Moderator ] :: Detaljnije

Najviše korisnika na forumu ikad bilo je 15694 - dana 01 Feb 2026 12:23

Korisnici koji su trenutno na forumu:
Korisnici trenutno na forumu: 10x10.9, 357magnum, A.R.Chafee.Jr., Agape, babaroga, bavar357, bobo85, Bojan198527, cifra, Clouseau, cuculo, darkojbn, dekan.m, Demi87, djboj, Djokislav, Dolinc, draganl, Duk011, dukajov, Dungorth, Džekson, ElGenius, Fructo, GandorCC, gobrad, Gogi_avio, Hardenberg, hellenic, ikan, Insan, Jezekijel, jon istvan, Kapetan Hadok, Kolimator, kolle.the.kid, Kubovac, KUZMAR, Langdorf, Ljusa, luka1978, marko.petrović92, marsi, Mis uz pusku, nemkea71, nisamBot, nuke92, ozzy, perunnurep, PlayerOne, PMsnow, Podljub, raketaš, raster12, Resad76, Resnica, SlaKoj, Srky Boy, Srle993, stegonosa, styg, suhoj27, TRAVUNIJA, TTN, v82, Vasilije74, vathra, VBoss, VekiJ, Vlad000, vladetije, Volkhov-M, vuksa72, zemljanin, zeo, Zoran1959, Žrnov, 223223