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 914 korisnika na forumu :: 25 registrovanih, 3 sakrivenih i 886 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: Ben Roj, Bobrock1, bojanM84, Boris90, darkojbn, Dorcolac, dozorni, elenemste, Još malo pa deda, Kaplar2, Mcdado, Mi lao shu, milos97, Misirac, Nemanja.M, Prašinar, procesor, raptorsi, ss10, stegonosa, Stoilkovic, vathra, virked, voja64, Zerajic