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 2742 korisnika na forumu :: 72 registrovanih, 7 sakrivenih i 2663 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, A.R.Chafee.Jr., aleksmajstor, Asteker, Automaticar, bigbear, bokisha253, Bubili, CCCP, cuvarkuca, Dannyboy, darkojovxp, dejno, Dixtrix, Djokislav, Dorcolac, dule10savic, EXIT78, fijufijukrozkapiju55, ghoost, gobrad, iceburn, ILGromovnik, Ir, JOntra, K a s p e r, Kobrim, Koca Popovic, komsija1, Kruger, ladro, Maki1981, Marko Marković, mercedesamg, Milan A. Nikolic, Mrav Obrad, narandzasti, Natuzzi, neko_drugi, nenad81, niksa517, ozzy, Pekman, Pilipenda, PlayerOne, Radogost, raster12, Romibrat, samsung, sickmouse, Sirius, Sićko, skok, Snorks, Sone0883, Stevan Visoki, sudzi, TripleTwo, trpche, Tvrtko I, Valter071, vdeki, vedko, Veless, xpforswodniw, YFSS33, zemljanin, ZetaMan, ziggga, zoran77, Zrcalo, 800077