- glBegin(GL_QUADS);
- glNormal3f(0, 0, 1.0);
-
- glTexCoord2f(in_x1 / get_texture_w(), in_y1 / get_texture_h());
- glVertex3f(out_x1, flip_y ? -out_y1 : -out_y2, 0);
-
- glTexCoord2f(in_x2 / get_texture_w(), in_y1 / get_texture_h());
- glVertex3f(out_x2, flip_y ? -out_y1 : -out_y2, 0);
-
- glTexCoord2f(in_x2 / get_texture_w(), in_y2 / get_texture_h());
- glVertex3f(out_x2, flip_y ? -out_y2 : -out_y1, 0);
-
- glTexCoord2f(in_x1 / get_texture_w(), in_y2 / get_texture_h());
- glVertex3f(out_x1, flip_y ? -out_y2 : -out_y1, 0);
-
-
- glEnd();
-
+ in_x1 /= get_texture_w(); in_y1 /= get_texture_h();
+ in_x2 /= get_texture_w(); in_y2 /= get_texture_h();
+ float ot_y1 = flip_y ? -out_y1 : -out_y2;
+ float ot_y2 = flip_y ? -out_y2 : -out_y1;
+ texture->draw_texture(
+ in_x1,in_y1, in_x2,in_y2,
+ out_x1,ot_y1, out_x2, ot_y2);