Drawing Rounded Rectangle in DirectX/3D for 2D

Posted by Jengerer on Stack Overflow See other posts from Stack Overflow or by Jengerer
Published on 2011-01-02T07:49:16Z Indexed on 2011/01/02 7:53 UTC
Read the original article Hit count: 342

Filed under:
|
|

I'm using Direct3D to draw 2D elements in a C++ application of mine, and it'd be neat if I could create rounded-rectangle GUI elements that were varying in size, but I'm not sure how to do that in the most efficient manner possible.

I thought of the "easy" way which would be to have images of the four corners and then just place them in the proper positions, and fill in the rest, but varying radii for the rectangle corners would be a definite plus, and this method doesn't accommodate that feature well.

Through my searches I've come across the terms Pixel Shader, Stencil Buffering, and HLSL, but I'm not sure whether these terms are relevant and which one to jump into if so.

Thanks in advance,
Jengerer

© Stack Overflow or respective owner

Related posts about c++

Related posts about direct3d