Fix for "draw images as texture"
Zooming in on images in Image window now shows pixels again (was filtered). Now the glaDrawPixelsTex() and glaDrawPixelsAuto() have an argument to define if images should zoom in with linear filter, or draw pixels.
This commit is contained in:
@@ -453,8 +453,7 @@ void ui_draw_but_IMAGE(ARegion *UNUSED(ar), uiBut *but, uiWidgetColors *UNUSED(w
|
||||
float facy = (float)h / (float)ibuf->y;
|
||||
glPixelZoom(facx, facy);
|
||||
}
|
||||
glaDrawPixelsSafe((float)rect->xmin, (float)rect->ymin, ibuf->x, ibuf->y, ibuf->x, GL_RGBA, GL_UNSIGNED_BYTE, ibuf->rect);
|
||||
//glaDrawPixelsTex((float)rect->xmin, (float)rect->ymin, ibuf->x, ibuf->y, GL_UNSIGNED_BYTE, ibuf->rect);
|
||||
glaDrawPixelsAuto((float)rect->xmin, (float)rect->ymin, ibuf->x, ibuf->y, GL_UNSIGNED_BYTE, GL_NEAREST, ibuf->rect);
|
||||
|
||||
glPixelZoom(1.0f, 1.0f);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user