void VFrame::draw_texture(float in_x1, float in_y1, float in_x2, float in_y2, float out_x1, float out_y1, float out_x2, float out_y2, int flip_y) { #ifdef HAVE_GL 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(); #endif }
//--------------------------------------------------------------------------- bool uv_image::set_size(int x, int y, int w, int h, float picx, float picy, float picw, float pich) { if(x < 0 || y < 0 || w < -2 || h < -2) return false; if(w == -1) w = get_texture_w(); if(h == -1) h = get_texture_h(); uv_widget::set_size(x, y, w, h); if(!((picx != -1 && picy != -1 && picw != -1 && pich != -1) || (picx == -1 && picy == -1 && picw == -1 && pich == -1)) || (picx < -1 || picy < -1 || picw < -1 || pich < -1)) return false; if(picx != -1) { this->picx = picx; this->picy = picy; this->picw = picw; this->pich = pich; } redraw = true; return true; };