From 4336c28c843923db3d9c8dc0a0cb2440ba94f064 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sun, 30 Jun 2002 16:07:18 +0000 Subject: [PATCH] CHAN_TYPE==GL_FLOAT clamping. call _tnl_MakeCurrent. (Gerk Huisma) --- src/mesa/drivers/osmesa/osmesa.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/mesa/drivers/osmesa/osmesa.c b/src/mesa/drivers/osmesa/osmesa.c index eb0515d..20847f6 100644 --- a/src/mesa/drivers/osmesa/osmesa.c +++ b/src/mesa/drivers/osmesa/osmesa.c @@ -1,4 +1,4 @@ -/* $Id: osmesa.c,v 1.84 2002/06/25 15:25:17 brianp Exp $ */ +/* $Id: osmesa.c,v 1.85 2002/06/30 16:07:18 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -488,6 +488,10 @@ OSMesaMakeCurrent( OSMesaContext ctx, void *buffer, GLenum type, _mesa_ResizeBuffersMESA(); } + /* Added by Gerk Huisma: */ + _tnl_MakeCurrent( &ctx->gl_ctx, ctx->gl_ctx.DrawBuffer, + ctx->gl_ctx.ReadBuffer ); + return GL_TRUE; } @@ -666,6 +670,15 @@ OSMesaGetProcAddress( const char *funcName ) * Useful macros: */ +#if CHAN_TYPE == GL_FLOAT +#define PACK_RGBA(DST, R, G, B, A) \ +do { \ + (DST)[0] = (R < 0.0f) ? 0.0f : ((R > 1.0f) ? 1.0f : R); \ + (DST)[1] = (G < 0.0f) ? 0.0f : ((G > 1.0f) ? 1.0f : G); \ + (DST)[2] = (B < 0.0f) ? 0.0f : ((B > 1.0f) ? 1.0f : B); \ + (DST)[3] = (A < 0.0f) ? 0.0f : ((A > 1.0f) ? 1.0f : A); \ +} while (0) +#else #define PACK_RGBA(DST, R, G, B, A) \ do { \ (DST)[osmesa->rInd] = R; \ @@ -673,6 +686,7 @@ do { \ (DST)[osmesa->bInd] = B; \ (DST)[osmesa->aInd] = A; \ } while (0) +#endif #define PACK_RGB(DST, R, G, B) \ do { \ -- 2.7.4