| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- #include "Point.h"
- #ifdef WIN32
- # include "Screen.h"
- # include "Window.h"
- #endif
- using namespace Framework;
- // other functions
- #ifdef WIN32
- inline Point Framework::ScreenSize(int mId) // Returns the screen size
- {
- Monitor m = getMonitor(mId);
- return Point(m.width, m.height);
- }
- inline Point Framework::ScreenCenter(int mId) // Returns the screen center
- {
- Monitor m = getMonitor(mId);
- return Point(m.x + m.width / 2, m.y + m.height / 2);
- }
- inline Point Framework::ScreenCenter(
- NativeWindow* f, int mId) // Returns the screen center
- {
- Point p = ScreenCenter(mId);
- Point p2 = f->getSize();
- f->release();
- return {p.x - p2.x / 2, p.y - p2.y / 2};
- }
- #endif
- bool Framework::operator>(
- const Point& a, const Point& b) // Indicates whether a > b
- {
- return a.x > b.x && a.y > b.y;
- }
- bool Framework::operator<(
- const Point& a, const Point& b) // Indicates whether a < b
- {
- return a.x < b.x && a.y < b.y;
- }
- bool Framework::operator<=(
- const Point& a, const Point& b) // Indicates whether a <= b
- {
- return a.x <= b.x && a.y <= b.y;
- }
- bool Framework::operator>=(
- const Point& a, const Point& b) // Indicates whether a >= b
- {
- return a.x >= b.x && a.y >= b.y;
- }
|