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 889 korisnika na forumu :: 98 registrovanih, 11 sakrivenih i 780 gosta   ::   [ Administrator ] [ Supermoderator ] [ Moderator ] :: Detaljnije

Najviše korisnika na forumu ikad bilo je 20624 - dana 04 Apr 2026 04:18

Korisnici koji su trenutno na forumu:
Korisnici trenutno na forumu: 357magnum, 3OPAH, aca018, airsuba, alonso, arsa, Atomski čoban, Avalon015, Barista, Bo96, Bojcca, bojcistv, Bombona, Boris BM, boxbole, BOXRR, BrcakRS, Burovnyak, CikaKURE, comi991, Darko Jovanovic, dejanlule72, djonsule, doktor1964, DonRumataEstorski, dskrlec33, g_g, ghoost, Giskard, Hans Gajger, icemilos, ILGromovnik, Ilija84, Imperator_Aleksandr_lll, Istman, Jablan, Jaxupa, jimi_agf, jmsk, jodzula, Jose, kaput21, Kiki98TZ, kikisp, komenski, konstruktor, kozhedub, Kružić, kybonacci, Limeni91, luka35, lukac, Marko Marković, Marko1238, MarkoDzimi, mat, MGBRBG, Milun24, minke, mir, Miškić, moldway, Muki 123, neko iz mase, nixos, Oklopnjak, omen, operniki, pera bager, Permaldar, Prečanin30, Radoslava, rovac, sale755, sap, Shadow soldier, Shinobi, slowhand, Solunac na steroidima, Srky Boy, stalja, Tafocus, TeodorSan, tmanda323, travisrise, tritonus, tubular, velibor, vidra1, Vlada1389, vladao75, wulfy, Yugol33, zastavnik, zeka013, Zimbabwe, Žrnov, 2001