MiniEngine/SDLWrapper/Rect.h

24 lines
454 B
C++
Raw Normal View History

2017-06-18 17:00:08 +08:00
#pragma once
#include "include.h"
2017-07-31 00:18:10 +08:00
namespace MiniEngine
{
2017-06-18 17:00:08 +08:00
class Rect
{
public:
int x, y, w, h;
Rect(int X, int Y, int W, int H);
explicit Rect(const SDL_Rect&);
Rect();
SDL_Rect toSDLRect() const;
2017-06-18 20:37:45 +08:00
bool isEmpty() const;
2017-06-18 17:00:08 +08:00
bool operator == (const Rect&) const;
bool hasIntersection(const Rect&) const;
Rect getIntersection(const Rect&) const;
Rect getUnion(const Rect&) const;
};
2017-07-31 00:18:10 +08:00
} /// End of namespace MiniEngine