For an addon, I want to draw a rectangle next to the mouse cursor. I tried using the gpu package, but it only works with draw handlers in a specific region or space. Since the shape needs to stay with the cursor, it could be anywhere on the window.
That leads me to bgl, but in 2.8x it looks deprecated - most code samples online to draw shapes with bgl don't work since functions and keywords are no longer included. Is there a way to draw a rectangle with bgl still in 2.8? Or do I need to look somewhere else?