Apparently zoom in clip editor was broken

Also silenced some warnings in glutil.
This commit is contained in:
Sergey Sharybin 2013-04-03 16:21:14 +00:00
parent 743552ff2a
commit e6a16e585c
2 changed files with 15 additions and 5 deletions

@ -533,8 +533,10 @@ void glaDrawPixelsTexScaled(float x, float y, int img_w, int img_h, int format,
components = 3; components = 3;
else if (format == GL_LUMINANCE) else if (format == GL_LUMINANCE)
components = 1; components = 1;
else else {
BLI_assert(!"Incompatible format passed to glaDrawPixelsTexScaled"); BLI_assert(!"Incompatible format passed to glaDrawPixelsTexScaled");
return;
}
if (type == GL_FLOAT) { if (type == GL_FLOAT) {
/* need to set internal format to higher range float */ /* need to set internal format to higher range float */
@ -1088,7 +1090,7 @@ void glaDrawImBuf_glsl_ctx(const bContext *C, ImBuf *ibuf, float x, float y, int
glColor4f(1.0, 1.0, 1.0, 1.0); glColor4f(1.0, 1.0, 1.0, 1.0);
if (ibuf->rect_float) { if (ibuf->rect_float) {
int format; int format = 0;
if (ibuf->channels == 3) if (ibuf->channels == 3)
format = GL_RGB; format = GL_RGB;
@ -1097,8 +1099,10 @@ void glaDrawImBuf_glsl_ctx(const bContext *C, ImBuf *ibuf, float x, float y, int
else else
BLI_assert(!"Incompatible number of channels for GLSL display"); BLI_assert(!"Incompatible number of channels for GLSL display");
glaDrawPixelsTex(x, y, ibuf->x, ibuf->y, format, GL_FLOAT, if (format != 0) {
zoomfilter, ibuf->rect_float); glaDrawPixelsTex(x, y, ibuf->x, ibuf->y, format, GL_FLOAT,
zoomfilter, ibuf->rect_float);
}
} }
else if (ibuf->rect) { else if (ibuf->rect) {
/* ibuf->rect is always RGBA */ /* ibuf->rect is always RGBA */

@ -279,7 +279,13 @@ static void draw_movieclip_buffer(const bContext *C, SpaceClip *sc, ARegion *ar,
filter = GL_NEAREST; filter = GL_NEAREST;
} }
glaDrawImBuf_glsl_ctx(C, ibuf, x, y, GL_NEAREST); /* set zoom */
glPixelZoom(zoomx * width / ibuf->x, zoomy * height / ibuf->y);
glaDrawImBuf_glsl_ctx(C, ibuf, x, y, filter);
/* reset zoom */
glPixelZoom(1.0f, 1.0f);
if (ibuf->planes == 32) if (ibuf->planes == 32)
glDisable(GL_BLEND); glDisable(GL_BLEND);