Drawing Rounded Rectangle in DirectX/3D for 2D
- by Jengerer
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