clip fixes, ladspa build fixes
[goodguy/history.git] / cinelerra-5.1 / guicast / vframe3d.C
index f6f0a440cf85fdf41364655287d660387e73465a..9f09f638c9b2011df545777aba483f33ef5923a8 100644 (file)
@@ -29,9 +29,6 @@
 #include "bcwindowbase.h"
 #include "vframe.h"
 
-#if defined(HAVE_CONFIG_H)
-#include "config.h"
-#endif
 #ifdef HAVE_GL
 #include <GL/gl.h>
 #include <GL/glext.h>
@@ -229,49 +226,26 @@ void VFrame::screen_to_ram()
 #endif
 }
 
-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)
+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();
-
+       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);
 #endif
 }
 
 void VFrame::draw_texture(int flip_y)
 {
-       draw_texture(0,
-               0,
-               get_w(),
-               get_h(),
-               0,
-               0,
-               get_w(),
-               get_h(),
-               flip_y);
+       draw_texture(0,0,  get_w(),get_h(),
+               0,0, get_w(),get_h(), flip_y);
 }
 
 
@@ -356,8 +330,8 @@ static int print_error(char *source, unsigned int object, int is_program)
                glGetShaderInfoLog(object, BCTEXTLEN, &len, string);
        if(len > 0) printf("Playback3D::print_error:\n%s\n%s\n", source, string);
        if(len > 0) return 1;
-       return 0;
 #endif
+       return 0;
 }