libsegl/glrect.cpp

36 lines
551 B
C++
Raw Normal View History

2008-02-09 13:43:23 +01:00
#include "glrect.h"
GLRect::GLRect() {
set(0.0f, 0.0f, 0.0f, 0.0f);
}
GLRect::GLRect(float _x, float _y, float _w, float _h) {
set(_x, _y, _w, _h);
}
GLRect::GLRect(const SDL_Rect &r) {
set(r.x, r.y, r.w, r.h);
}
void GLRect::set(float _x, float _y, float _w, float _h) {
x = _x;
y = _y;
w = _w;
h = _h;
}
void GLRect::setPoint(float _x, float _y) {
x = _x;
y = _y;
}
void GLRect::setDim(float _w, float _h) {
w = _w;
h = _h;
}
SDL_Rect GLRect::getSDLRect() {
SDL_Rect tmp = {(Uint8)x, (Uint8)y, (Uint8)w, (Uint8)h};
return tmp;
}