summaryrefslogtreecommitdiff
path: root/src/drv/cdgl.c
diff options
context:
space:
mode:
authorscuri <scuri>2010-08-11 18:59:02 +0000
committerscuri <scuri>2010-08-11 18:59:02 +0000
commit9cbce601c709dc301887316d8952567ceee341c2 (patch)
tree8d3ff78219d32f1df61955acb7743388e5f0150b /src/drv/cdgl.c
parent7709d543806354bf7fbe405f7761830e463d9bc3 (diff)
# Fixed: cdCanvasClear not considering the transparency of the background color in the GDI+ base driver and in the CD_GL driver.
# Fixed: background transparency was not being considered when backopacity was set to OPAQUE after the background color was set in the GDI+ base driver.
Diffstat (limited to 'src/drv/cdgl.c')
-rw-r--r--src/drv/cdgl.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/drv/cdgl.c b/src/drv/cdgl.c
index 4357e5a..fb1739d 100644
--- a/src/drv/cdgl.c
+++ b/src/drv/cdgl.c
@@ -638,10 +638,11 @@ static long int cdforeground(cdCtxCanvas *ctxcanvas, long int color)
static void cdclear(cdCtxCanvas* ctxcanvas)
{
- unsigned char r, g, b;
+ unsigned char r, g, b, a;
cdDecodeColor(ctxcanvas->canvas->background, &r, &g, &b);
- glClearColor((GLclampf)((double)r/255.0), (GLclampf)((double)g/255.0), (GLclampf)((double)b/255.0), 0);
- glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+ a = cdDecodeAlpha(ctxcanvas->canvas->background);
+ glClearColor((GLclampf)r/255.0f, (GLclampf)g/255.0f, (GLclampf)b/255.0f, (GLclampf)a/255.0f);
+ glClear(GL_COLOR_BUFFER_BIT);
}
static void cdfline(cdCtxCanvas *ctxcanvas, double x1, double y1, double x2, double y2)