You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
555 B

#include "gldrawhelper.h"
void GLDrawSDLRect(SDL_Rect *rect, GLRect *tex) {
GLRect tmptex;
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();
}