+inline void intern_draw(float left, float top, float right, float bottom,
+ float uv_left, float uv_top,
+ float uv_right, float uv_bottom,
+ float angle, float alpha,
+ const Color& color,
+ const Blend& blend,
+ DrawingEffect effect)
+{
+ if(effect & HORIZONTAL_FLIP)
+ std::swap(uv_left, uv_right);
+
+ if(effect & VERTICAL_FLIP)
+ std::swap(uv_top, uv_bottom);
+
+ // unrotated blit
+ glBlendFunc(blend.sfactor, blend.dfactor);
+ glColor4f(color.red, color.green, color.blue, color.alpha * alpha);
+
+ if (angle == 0.0f) {
+ float vertices[] = {
+ left, top,
+ right, top,
+ right, bottom,
+ left, bottom,
+ };
+ glVertexPointer(2, GL_FLOAT, 0, vertices);
+
+ float uvs[] = {
+ uv_left, uv_top,
+ uv_right, uv_top,
+ uv_right, uv_bottom,
+ uv_left, uv_bottom,
+ };
+ glTexCoordPointer(2, GL_FLOAT, 0, uvs);
+
+ glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
+ } else {
+ // rotated blit