10 inline float RealToFloat(Real r) {return r;}
11 inline Real Random(Real max=1, Real min=0)
13 return min + (max-min) * ((Real)(rand() % (int)1e6) / 1e6);
16 typedef unsigned ObjectID;
17 typedef enum {RECT_FILLED, RECT_OUTLINE} ObjectType;
21 Real x; Real y; Real w; Real h;
22 Rect() = default; // Needed so we can fread/fwrite this struct
23 Rect(Real _x, Real _y, Real _w, Real _h) : x(_x), y(_y), w(_w), h(_h) {}
27 s << "{" << x << ", " << y << ", " << w << ", " << h << "}";
34 std::vector<ObjectType> types;
35 std::vector<Rect> bounds;