![]() |
|
al_set_clipping_rectangle behaivor |
AMCerasoli
Member #11,955
May 2010
![]() |
Guys I don't understand how the clipping rectangle function works. I'm drawing a rectangle using this: int x,y,w,h; al_get_clipping_rectangle(&x, &y, &w, &h); std::cout<<"x: "<<x<<" y: "<<y<<" w: "<<w<<" h: "<<h<<std::endl; awDrawRectangle(x, y, w, h, 255, 0, 0, 255, false); and setting the clipping rectangle like this: al_set_clipping_rectangle(mouse.posX, mouse.posY, mouse.posX+50, mouse.posY+50); And I'm getting this: I don't understand why that's happening. Shouldn't I see only that tiny rectangle filled with the back-buffer bitmap?
|
Edgar Reynaldo
Major Reynaldo
May 2007
![]() |
You're passing the bottom right x and y instead of the width and height. al_set_clipping_rectangle(x,y,w,h); My Website! | EAGLE GUI Library Demos | My Deviant Art Gallery | Spiraloid Preview | A4 FontMaker | Skyline! (Missile Defense) Eagle and Allegro 5 binaries | Older Allegro 4 and 5 binaries | Allegro 5 compile guide |
AMCerasoli
Member #11,955
May 2010
![]() |
Oh it's true man! hehehe I'm burned out, too much programming for now, I was unable to see that, so the function already adds the width and height relative to the position. Edgar...
|
Edgar Reynaldo
Major Reynaldo
May 2007
![]() |
Sorry AMC, my heart belongs to someone else. My Website! | EAGLE GUI Library Demos | My Deviant Art Gallery | Spiraloid Preview | A4 FontMaker | Skyline! (Missile Defense) Eagle and Allegro 5 binaries | Older Allegro 4 and 5 binaries | Allegro 5 compile guide |
|