2008-02-09 13:43:23 +01:00
|
|
|
#include "gldrawhelper.h"
|
|
|
|
|
2008-08-10 17:14:54 +02:00
|
|
|
namespace segl {
|
|
|
|
|
|
|
|
void GLDrawSDLRect(SDL_Rect *rect, Rect *tex) {
|
|
|
|
Rect tmptex;
|
2008-02-09 13:43:23 +01:00
|
|
|
if(tex) {
|
|
|
|
tmptex = *tex;
|
|
|
|
} else {
|
|
|
|
tmptex.set(0.0f, 0.0f, 1.0f, 1.0f);
|
|
|
|
}
|
|
|
|
|
|
|
|
glBegin(GL_QUADS);
|
|
|
|
glTexCoord2f(tmptex.x, tmptex.y);
|
|
|
|
glVertex2i(rect->x, rect->y+rect->h);
|
|
|
|
|
|
|
|
glTexCoord2f(tmptex.x+tmptex.w, tmptex.y);
|
|
|
|
glVertex2i(rect->x+rect->w, rect->y+rect->h);
|
|
|
|
|
|
|
|
glTexCoord2f(tmptex.x+tmptex.w, tmptex.y+tmptex.h);
|
|
|
|
glVertex2i(rect->x+rect->w, rect->y);
|
|
|
|
|
|
|
|
glTexCoord2f(tmptex.x, tmptex.y+tmptex.h);
|
|
|
|
glVertex2i(rect->x, rect->y);
|
|
|
|
glEnd();
|
|
|
|
}
|
2008-08-10 17:14:54 +02:00
|
|
|
|
|
|
|
} // namespace segl
|