Open XeroOl opened 6 days ago
There are two ways of drawing rectangle lines in OpenGL and Raysan5 is choosing between them. RayLib 5 implemented one way, RayLib master another. Both ways may produce visual inaccuracies depending on situation and GPU driver, plus the first way is slower. If you are using RayLib master and see visual artifacts, try re-implementing the first way from RayLib 5 and see if it works for you.
void DrawRectangleFrame(int posX, int posY, int width, int height, int thickness, Color color)
{
// Based on https://github.com/raysan5/raylib/blob/29ce13b77736f4eb2fa6018d9c164d76c4df54bc/src/rshapes.c#L811
DrawRectangle(posX, posY, width, thickness, color);
DrawRectangle(posX + width - thickness, posY + thickness, thickness, height - 2 * thickness, color);
DrawRectangle(posX, posY + height - thickness, width, thickness, color);
DrawRectangle(posX, posY + thickness, thickness, height - 2 * thickness, color);
}
Actually this issue is still being reviewed, there is also another open issue and an open PR...
I expected the DrawRectangleLines function to draw a closed rectangle, but it seems to have coordinates wrong, because it didn't exactly draw a rectangle.
Environment
Raylib Desktop. Arch Linux. AMD Radeon RX 6950 XT GPU Says it supports OpenGL 4.6, Not sure how to check which one raylib is using.
Code Example