Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Bug Reports / DBP 7.4 - Box function does't work properly

Author
Message
Chris66
14
Years of Service
User Offline
Joined: 12th Aug 2009
Location:
Posted: 18th Mar 2010 18:17
Hi,

The "Box" function doesn't work properly : it draws the box X1,Y1,X2-1,Y2-1 instead of X1,Y1,X2,Y2.





Cheers,
Chris
IanM
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 19th Mar 2010 15:45
It's not a bug, it's by design, or rather, it's using the default for DirectX rendering which is inclusive/exclusive rendering (inclusive of the start coords, up to but exclusive of the end coords).

The idea is that if you want a box of x-by-y pixels to be rendered, you take the start coordinates, add the sizes, and then use the result as the end coordinates.

The alternative of inclusive/inclusive means that you do the same, but subtract 1 from each of the end coordinates before rendering.

You didn't notice, but the LINE command works in exactly the same way.

Chris66
14
Years of Service
User Offline
Joined: 12th Aug 2009
Location:
Posted: 19th Mar 2010 17:37
Hi,

Thanks a lot for your explanations. I didn't know the DirectX inclusive/exclusive concepts... so far.


Quote: "You didn't notice, but the LINE command works in exactly the same way."


Indeed, I just ran the code again and noticed that the pixel (50,50) wasn't drawn.


Sorry, I'am an old school programmer and I have got to forget my obsolete VGA/SVGA card programming habits and to learn more about the functionalities of DirectX.

Cheers,

Chris

Login to post a reply

Server time is: 2024-04-20 04:41:03
Your offset time is: 2024-04-20 04:41:03