| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- #include "Punkt.h"
- #ifdef WIN32
- # include "Bildschirm.h"
- # include "Fenster.h"
- #endif
- using namespace Framework;
- // other functions
- #ifdef WIN32
- inline Punkt Framework::BildschirmGroesse(int mId) // Returns the screen size
- {
- Monitor m = getMonitor(mId);
- return Punkt(m.breite, m.height);
- }
- inline Punkt Framework::Bildschirmmitte(int mId) // Returns the screen center
- {
- Monitor m = getMonitor(mId);
- return Punkt(m.x + m.breite / 2, m.y + m.height / 2);
- }
- inline Punkt Framework::Bildschirmmitte(
- WFenster* f, int mId) // Returns the screen center
- {
- Punkt p = Bildschirmmitte(mId);
- Punkt p2 = f->getGroesse();
- f->release();
- return {p.x - p2.x / 2, p.y - p2.y / 2};
- }
- #endif
- bool Framework::operator>(
- const Punkt& a, const Punkt& b) // Indicates whether a > b
- {
- return a.x > b.x && a.y > b.y;
- }
- bool Framework::operator<(
- const Punkt& a, const Punkt& b) // Indicates whether a < b
- {
- return a.x < b.x && a.y < b.y;
- }
- bool Framework::operator<=(
- const Punkt& a, const Punkt& b) // Indicates whether a <= b
- {
- return a.x <= b.x && a.y <= b.y;
- }
- bool Framework::operator>=(
- const Punkt& a, const Punkt& b) // Indicates whether a >= b
- {
- return a.x >= b.x && a.y >= b.y;
- }
|