Je kunt niet meer dan 25 onderwerpen selecteren Onderwerpen moeten beginnen met een letter of nummer, kunnen streepjes bevatten ('-') en kunnen maximaal 35 tekens lang zijn.

36 regels
551 B

#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;
}