From 33740c5eb56884929b70a394e5b3dc7ceb0cfc91 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Wed, 28 Mar 2012 09:07:10 +0000 Subject: Cycles: viewport rendered draw mode now shows background images, also changed the image editor checkerboard pattern to be the same as cycles viewport. --- source/blender/editors/screen/glutil.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'source/blender/editors/screen/glutil.c') diff --git a/source/blender/editors/screen/glutil.c b/source/blender/editors/screen/glutil.c index 28fe8caf34b..66abbaecbe7 100644 --- a/source/blender/editors/screen/glutil.c +++ b/source/blender/editors/screen/glutil.c @@ -191,6 +191,31 @@ void fdrawbox(float x1, float y1, float x2, float y2) glEnd(); } +void fdrawcheckerboard(float x1, float y1, float x2, float y2) +{ + unsigned char col1[4]= {40, 40, 40}, col2[4]= {50, 50, 50}; + + GLubyte checker_stipple[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, + }; + + glColor3ubv(col1); + glRectf(x1, y1, x2, y2); + glColor3ubv(col2); + + glEnable(GL_POLYGON_STIPPLE); + glPolygonStipple(checker_stipple); + glRectf(x1, y1, x2, y2); + glDisable(GL_POLYGON_STIPPLE); +} + void sdrawline(short x1, short y1, short x2, short y2) { short v[2]; -- cgit v1.2.3