Cycles: viewport rendered draw mode now shows background images, also changed the

image editor checkerboard pattern to be the same as cycles viewport.
This commit is contained in:
Brecht Van Lommel
2012-03-28 09:07:10 +00:00
parent 30d128c7a7
commit 33740c5eb5
6 changed files with 39 additions and 51 deletions

View File

@@ -250,36 +250,10 @@ void DisplayBuffer::draw_set(int width, int height)
draw_height = height;
}
void DisplayBuffer::draw_transparency_grid()
{
GLubyte checker_stipple_sml[32*32/8] = {
255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0, \
255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0, \
0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255, \
0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255, \
255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0, \
255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0, \
0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255, \
0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255, \
};
glColor4ub(50, 50, 50, 255);
glRectf(0, 0, params.width, params.height);
glEnable(GL_POLYGON_STIPPLE);
glColor4ub(55, 55, 55, 255);
glPolygonStipple(checker_stipple_sml);
glRectf(0, 0, params.width, params.height);
glDisable(GL_POLYGON_STIPPLE);
}
void DisplayBuffer::draw(Device *device)
{
if(draw_width != 0 && draw_height != 0) {
if(transparent)
draw_transparency_grid();
if(draw_width != 0 && draw_height != 0)
device->draw_pixels(rgba, 0, draw_width, draw_height, 0, params.width, params.height, transparent);
}
}
bool DisplayBuffer::draw_ready()