- Mesa 4.0 DOS/DJGPP Port v1.1\r
+ Mesa 4.1 DOS/DJGPP Port v1.2\r
~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r
\r
\r
Description:\r
~~~~~~~~~~~~\r
\r
-Well, guess what... this is the DOS port of Mesa 4.0.4, for DJGPP fans... Whoa!\r
+Well, guess what... this is the DOS port of Mesa 4.1, for DJGPP fans... Whoa!\r
The driver has its origins in ddsample.c, written by Brian Paul and found by me\r
in Mesa 3.4.2.\r
\r
CPU: K6-2 (CXT) @500(412.5) MHz\r
Mainboard: ViA Apollo VP2/97 w/ 128 MB SDRAM\r
Video card: PowerColor Evil King3 (Voodoo3 3000) w/ 16384 kB SDRAM\r
- DJGPP: djdev 2.03 + gcc v3.1 + make v3.79.1\r
+ DJGPP: djdev 2.04 + gcc v3.2 + make v3.79.1\r
\r
\r
\r
A) You must have the DXE2 package (available on SimTel.Net, courtesy of\r
Andrew Zabolotny) installed in order to build the dynamic modules.\r
\r
- Q) I have DXE2, but I couln'd build the `dxe2gen.exe'.\r
+ Q) I have DXE2, but I couldn't build the `dxe2gen.exe'.\r
Q) I built `dxe2gen.exe', but it doesn't do the job right.\r
A) There is a patched version on my web page.\r
\r
Q) DXE2 modules give me headaches...\r
A) The DXE2 modules are not compulsory. The static libraries are still built\r
- and you can use them in the old-fashioned, classic way. For example:\r
+ and you can use them in the old-fashioned, classic way... and learn to\r
+ live with your ~2MB executable size. For example:\r
gcc -o OUT.exe IN.c -lglut -lglu -lgl\r
\r
Q) Okay, DXE2 modules are built. How can I use them?\r
- A) Usage of the dynamic modules requires three things:\r
- - include DMESADXE.H in one of the sources, so references inside\r
- dynamic modules will get resolved (or use `-include' directive).\r
- - link against import libraries (libI*.a) and LIBDL.A, which will do\r
- the dynamic linkage job for you\r
- - put the DXEs somewhere along the library path (LD_LIBRARY_PATH) or\r
- in the current directory\r
+ A) Build your export object file; then link it with your application.\r
For example:\r
- gcc -o OUT.exe -include dmesadxe.h IN.c -ligl -liglu -liglut -ldl\r
+ dxe2res -o dmesadxe.c gl.dxe glu.dxe glut.dxe\r
+ gcc -o dmesadxe.o dmesadxe.c\r
+ gcc -o OUT.exe dmesadxe.o IN.c -liglut -liglu -ligl -ldl\r
\r
- Q) The application dies with "Abort!" due to unresolved symbols.\r
- A) This is bad! Extract the unresolved symbol list from this module. For\r
- example:\r
- dxe2gen --show-unres gl.dxe > u\r
- Check DMESADXE.H; the symbols in `u' must either be present here or be\r
- exported from another module that has to be loaded before your faulting\r
- one. Then recompile.\r
+ Q) What is that `dxe2res.exe' thing?\r
+ A) That is an utility that generates the export file for a given set of\r
+ modules. If you can't find it in the DXE2 package, you must be looking at\r
+ the wrong archive :)\r
\r
3. Using Mesa for DJGPP\r
\r
GLUT took this into account for _WIN32 DLL's only; I don't want to modify\r
his headers. The only workaround is to link GLUT the old way :-(\r
\r
- Q) The DJGPP port of Mesa is so SLOOOW! The Win32 OpenGL performs so much\r
+ Q) DMesa is so SLOOOW! The Win32 OpenGL performs so much\r
better...\r
A) Is that a question? If you have a Voodoo3/Banshee card, you're lucky. The\r
Glide port is on my web page. If you haven't, sorry; everything is done\r
~~~~~~~~\r
\r
v1.0 mar-2002 initial release\r
+\r
v1.1 sep-2002 + added 3dfx Glide3 support\r
+ added refresh rate control\r
+ added fonts in glut\r
* lots of minor changes\r
\r
+v1.2 nov-2002 * synced w/ Mesa-4.1\r
+ - removed dmesadxe.h\r
+\r
\r
\r
Contact:\r
/*\r
* Mesa 3-D graphics library\r
- * Version: 4.0\r
+ * Version: 4.1\r
* \r
* Copyright (C) 1999 Brian Paul All Rights Reserved.\r
* \r
*/\r
\r
/*\r
- * DOS/DJGPP device driver v1.1 for Mesa 4.0\r
+ * DOS/DJGPP device driver v1.2 for Mesa 4.1\r
*\r
* Copyright (C) 2002 - Borca Daniel\r
* Email : dborca@yahoo.com\r
\r
\r
\r
-static void dmesa_update_state (GLcontext *ctx, GLuint new_state);\r
-\r
-\r
-\r
-/**********************************************************************/\r
-/***** Read/Write pixels *****/\r
-/**********************************************************************/\r
-\r
-\r
-\r
+/****************************************************************************\r
+ * Read/Write pixels\r
+ ***************************************************************************/\r
#define FLIP(y) (c->Buffer->height - (y) - 1)\r
#define FLIP2(y) (h - (y) - 1)\r
\r
-\r
-\r
static void write_rgba_span (const GLcontext *ctx, GLuint n, GLint x, GLint y,\r
const GLubyte rgba[][4], const GLubyte mask[])\r
{\r
- DMesaContext c = (DMesaContext)ctx->DriverCtx;\r
+ const DMesaContext c = (DMesaContext)ctx->DriverCtx;\r
void *b = c->Buffer->the_window;\r
GLuint i, offset;\r
\r
}\r
}\r
\r
+\r
+\r
static void write_rgb_span (const GLcontext *ctx, GLuint n, GLint x, GLint y,\r
const GLubyte rgb[][3], const GLubyte mask[])\r
{\r
- DMesaContext c = (DMesaContext)ctx->DriverCtx;\r
+ const DMesaContext c = (DMesaContext)ctx->DriverCtx;\r
void *b = c->Buffer->the_window;\r
GLuint i, offset;\r
\r
}\r
}\r
\r
+\r
+\r
static void write_mono_rgba_span (const GLcontext *ctx,\r
GLuint n, GLint x, GLint y,\r
const GLchan color[4], const GLubyte mask[])\r
{\r
- DMesaContext c = (DMesaContext)ctx->DriverCtx;\r
+ const DMesaContext c = (DMesaContext)ctx->DriverCtx;\r
void *b = c->Buffer->the_window;\r
GLuint i, offset, rgba = vl_mixrgba(color);\r
\r
}\r
}\r
\r
+\r
+\r
static void read_rgba_span (const GLcontext *ctx, GLuint n, GLint x, GLint y,\r
GLubyte rgba[][4])\r
{\r
- DMesaContext c = (DMesaContext)ctx->DriverCtx;\r
+ const DMesaContext c = (DMesaContext)ctx->DriverCtx;\r
void *b = c->Buffer->the_window;\r
GLuint i, offset;\r
\r
}\r
}\r
\r
+\r
+\r
static void write_rgba_pixels (const GLcontext *ctx,\r
GLuint n, const GLint x[], const GLint y[],\r
const GLubyte rgba[][4], const GLubyte mask[])\r
{\r
- DMesaContext c = (DMesaContext)ctx->DriverCtx;\r
+ const DMesaContext c = (DMesaContext)ctx->DriverCtx;\r
void *b = c->Buffer->the_window;\r
GLuint i, w = c->Buffer->width, h = c->Buffer->height;\r
\r
}\r
}\r
\r
+\r
+\r
static void write_mono_rgba_pixels (const GLcontext *ctx,\r
GLuint n, const GLint x[], const GLint y[],\r
const GLchan color[4], const GLubyte mask[])\r
{\r
- DMesaContext c = (DMesaContext)ctx->DriverCtx;\r
+ const DMesaContext c = (DMesaContext)ctx->DriverCtx;\r
void *b = c->Buffer->the_window;\r
GLuint i, w = c->Buffer->width, h = c->Buffer->height, rgba = vl_mixrgba(color);\r
\r
}\r
}\r
\r
+\r
+\r
static void read_rgba_pixels (const GLcontext *ctx,\r
GLuint n, const GLint x[], const GLint y[],\r
GLubyte rgba[][4], const GLubyte mask[])\r
{\r
- DMesaContext c = (DMesaContext)ctx->DriverCtx;\r
+ const DMesaContext c = (DMesaContext)ctx->DriverCtx;\r
void *b = c->Buffer->the_window;\r
GLuint i, w = c->Buffer->width, h = c->Buffer->height;\r
\r
\r
\r
\r
-/**********************************************************************/\r
-/***** Optimized triangle rendering *****/\r
-/**********************************************************************/\r
-\r
-\r
+/****************************************************************************\r
+ * Optimized triangle rendering\r
+ ***************************************************************************/\r
\r
/*\r
* flat, NON-depth-buffered, triangle.\r
const SWvertex *v1,\r
const SWvertex *v2)\r
{\r
- DMesaContext c = (DMesaContext)ctx->DriverCtx;\r
+ const DMesaContext c = (DMesaContext)ctx->DriverCtx;\r
void *b = c->Buffer->the_window;\r
GLuint w = c->Buffer->width, h = c->Buffer->height;\r
\r
\r
#define RENDER_SPAN(span) \\r
GLuint i, offset = FLIP2(span.y)*w + span.x; \\r
- for (i = 0; i < span.count; i++, offset++) { \\r
+ for (i = 0; i < span.end; i++, offset++) { \\r
vl_putpixel(b, offset, rgb); \\r
}\r
\r
const SWvertex *v1,\r
const SWvertex *v2)\r
{\r
- DMesaContext c = (DMesaContext)ctx->DriverCtx;\r
+ const DMesaContext c = (DMesaContext)ctx->DriverCtx;\r
void *b = c->Buffer->the_window;\r
GLuint w = c->Buffer->width, h = c->Buffer->height;\r
\r
\r
#define RENDER_SPAN(span) \\r
GLuint i, offset = FLIP2(span.y)*w + span.x; \\r
- for (i = 0; i < span.count; i++, offset++) { \\r
+ for (i = 0; i < span.end; i++, offset++) { \\r
const DEPTH_TYPE z = FixedToDepth(span.z); \\r
if (z < zRow[i]) { \\r
vl_putpixel(b, offset, rgb); \\r
const SWvertex *v1,\r
const SWvertex *v2)\r
{\r
- DMesaContext c = (DMesaContext)ctx->DriverCtx;\r
+ const DMesaContext c = (DMesaContext)ctx->DriverCtx;\r
void *b = c->Buffer->the_window;\r
GLuint w = c->Buffer->width, h = c->Buffer->height;\r
\r
#define INTERP_RGB 1\r
#define RENDER_SPAN(span) \\r
GLuint i, offset = FLIP2(span.y)*w + span.x; \\r
- for (i = 0; i < span.count; i++, offset++) { \\r
+ for (i = 0; i < span.end; i++, offset++) { \\r
unsigned char rgb[3]; \\r
rgb[0] = FixedToInt(span.red); \\r
rgb[1] = FixedToInt(span.green); \\r
const SWvertex *v1,\r
const SWvertex *v2)\r
{\r
- DMesaContext c = (DMesaContext)ctx->DriverCtx;\r
+ const DMesaContext c = (DMesaContext)ctx->DriverCtx;\r
void *b = c->Buffer->the_window;\r
GLuint w = c->Buffer->width, h = c->Buffer->height;\r
\r
\r
#define RENDER_SPAN(span) \\r
GLuint i, offset = FLIP2(span.y)*w + span.x; \\r
- for (i = 0; i < span.count; i++, offset++) { \\r
+ for (i = 0; i < span.end; i++, offset++) { \\r
const DEPTH_TYPE z = FixedToDepth(span.z); \\r
if (z < zRow[i]) { \\r
unsigned char rgb[3]; \\r
\r
\r
\r
-/**********************************************************************/\r
-/***** Miscellaneous device driver funcs *****/\r
-/**********************************************************************/\r
+/****************************************************************************\r
+ * Miscellaneous device driver funcs\r
+ ***************************************************************************/\r
\r
-\r
-\r
-static void clear_color (GLcontext *ctx, const GLchan color[4])\r
+static void clear_color (GLcontext *ctx, const GLfloat color[4])\r
{\r
- const GLubyte col[4];\r
+ GLubyte col[4];\r
DMesaContext c = (DMesaContext)ctx->DriverCtx;\r
CLAMPED_FLOAT_TO_UBYTE(col[0], color[0]);\r
CLAMPED_FLOAT_TO_UBYTE(col[1], color[1]);\r
static void clear (GLcontext *ctx, GLbitfield mask, GLboolean all,\r
GLint x, GLint y, GLint width, GLint height)\r
{\r
- DMesaContext c = (DMesaContext)ctx->DriverCtx;\r
+ const DMesaContext c = (DMesaContext)ctx->DriverCtx;\r
const GLuint *colorMask = (GLuint *)&ctx->Color.ColorMask;\r
DMesaBuffer b = c->Buffer;\r
\r
\r
\r
\r
-/*\r
- * Set the current reading buffer.\r
- */\r
-static void set_read_buffer (GLcontext *ctx, GLframebuffer *buffer,\r
- GLenum mode)\r
+static void color_mask (GLcontext *ctx, GLboolean rmask, GLboolean gmask, GLboolean bmask, GLboolean amask)\r
{\r
- /*\r
- XXX this has to be fixed\r
- */\r
+ /*\r
+ * XXX todo - Implements glColorMask()\r
+ */\r
}\r
\r
\r
\r
-/*\r
- * Set the destination/draw buffer.\r
- */\r
-static void set_draw_buffer (GLcontext *ctx, GLenum mode)\r
+static void set_buffer (GLcontext *ctx, GLframebuffer *colorBuffer, GLuint bufferBit)\r
{\r
- /*\r
- XXX this has to be fixed\r
- */\r
+ /*\r
+ * XXX todo - examine bufferBit and set read/write pointers\r
+ */\r
+}\r
+\r
+\r
+\r
+static void enable (GLcontext *ctx, GLenum pname, GLboolean state)\r
+{\r
+ /*\r
+ * XXX todo -\r
+ */\r
}\r
\r
\r
{\r
switch (name) {\r
case GL_RENDERER:\r
- return (const GLubyte *)"Mesa DJGPP\0port (c) Borca Daniel 3-sep-2002";\r
+ return (const GLubyte *)"Mesa DJGPP\0port (c) Borca Daniel nov-2002";\r
default:\r
return NULL;\r
}\r
\r
\r
\r
-/**********************************************************************/\r
-/***** Miscellaneous device driver funcs *****/\r
-/***** Note that these functions are mandatory *****/\r
-/**********************************************************************/\r
-\r
-\r
-\r
-/* OPTIONAL FUNCTION: implements glFinish if possible */\r
static void finish (GLcontext *ctx)\r
{\r
-/*\r
- DMesaContext c = (DMesaContext)ctx->DriverCtx;\r
-*/\r
+ /*\r
+ * XXX todo - OPTIONAL FUNCTION: implements glFinish if possible\r
+ */\r
}\r
\r
\r
\r
-/* OPTIONAL FUNCTION: implements glFlush if possible */\r
static void flush (GLcontext *ctx)\r
{\r
-/*\r
- DMesaContext c = (DMesaContext)ctx->DriverCtx;\r
-*/\r
+ /*\r
+ * XXX todo - OPTIONAL FUNCTION: implements glFlush if possible\r
+ */\r
}\r
\r
\r
\r
-/**********************************************************************/\r
-/**********************************************************************/\r
-\r
-\r
-\r
+/****************************************************************************\r
+ * State\r
+ ***************************************************************************/\r
#define DMESA_NEW_TRIANGLE (_NEW_POLYGON | \\r
_NEW_TEXTURE | \\r
_NEW_LIGHT | \\r
_NEW_RENDERMODE | \\r
_SWRAST_NEW_RASTERMASK)\r
\r
-\r
-\r
/* Extend the software rasterizer with our line and triangle\r
* functions.\r
*/\r
/* Setup pointers and other driver state that is constant for the life\r
* of a context.\r
*/\r
-void dmesa_init_pointers (GLcontext *ctx)\r
+static void dmesa_init_pointers (GLcontext *ctx)\r
{\r
TNLcontext *tnl;\r
-\r
- ctx->Driver.UpdateState = dmesa_update_state;\r
+ struct swrast_device_driver *dd = _swrast_GetDeviceDriverReference(ctx);\r
\r
ctx->Driver.GetString = get_string;\r
ctx->Driver.GetBufferSize = get_buffer_size;\r
ctx->Driver.CopyPixels = _swrast_CopyPixels;\r
ctx->Driver.DrawPixels = _swrast_DrawPixels;\r
ctx->Driver.ReadPixels = _swrast_ReadPixels;\r
+ ctx->Driver.DrawBuffer = _swrast_DrawBuffer;\r
\r
/* Software texture functions:\r
*/\r
ctx->Driver.TexSubImage3D = _mesa_store_texsubimage3d;\r
ctx->Driver.TestProxyTexImage = _mesa_test_proxy_teximage;\r
\r
+ ctx->Driver.CopyTexImage1D = _swrast_copy_teximage1d;\r
+ ctx->Driver.CopyTexImage2D = _swrast_copy_teximage2d;\r
+ ctx->Driver.CopyTexSubImage1D = _swrast_copy_texsubimage1d;\r
+ ctx->Driver.CopyTexSubImage2D = _swrast_copy_texsubimage2d;\r
+ ctx->Driver.CopyTexSubImage3D = _swrast_copy_texsubimage3d;\r
+\r
ctx->Driver.CompressedTexImage1D = _mesa_store_compressed_teximage1d;\r
ctx->Driver.CompressedTexImage2D = _mesa_store_compressed_teximage2d;\r
ctx->Driver.CompressedTexImage3D = _mesa_store_compressed_teximage3d;\r
ctx->Driver.CompressedTexSubImage2D = _mesa_store_compressed_texsubimage2d;\r
ctx->Driver.CompressedTexSubImage3D = _mesa_store_compressed_texsubimage3d;\r
\r
- ctx->Driver.CopyTexImage1D = _swrast_copy_teximage1d;\r
- ctx->Driver.CopyTexImage2D = _swrast_copy_teximage2d;\r
- ctx->Driver.CopyTexSubImage1D = _swrast_copy_texsubimage1d;\r
- ctx->Driver.CopyTexSubImage2D = _swrast_copy_texsubimage2d;\r
- ctx->Driver.CopyTexSubImage3D = _swrast_copy_texsubimage3d;\r
-\r
/* Swrast hooks for imaging extensions:\r
*/\r
ctx->Driver.CopyColorTable = _swrast_CopyColorTable;\r
\r
/* Statechange callbacks:\r
*/\r
- ctx->Driver.SetDrawBuffer = set_draw_buffer;\r
ctx->Driver.ClearColor = clear_color;\r
+ ctx->Driver.ColorMask = color_mask;\r
+ ctx->Driver.Enable = enable;\r
\r
/* Initialize the TNL driver interface:\r
*/\r
tnl = TNL_CONTEXT(ctx);\r
tnl->Driver.RunPipeline = _tnl_run_pipeline;\r
+\r
+ dd->SetBuffer = set_buffer;\r
\r
/* Install swsetup for tnl->Driver.Render.*:\r
*/\r
\r
static void dmesa_update_state (GLcontext *ctx, GLuint new_state)\r
{\r
- DMesaContext c = (DMesaContext)ctx->DriverCtx;\r
- struct swrast_device_driver *swdd = _swrast_GetDeviceDriverReference(ctx);\r
+ struct swrast_device_driver *dd = _swrast_GetDeviceDriverReference(ctx);\r
\r
- /* Initialize all the pointers in the DD struct. Do this whenever */\r
- /* a new context is made current or we change buffers via set_buffer! */\r
-\r
- _swrast_InvalidateState(ctx, new_state);\r
- _swsetup_InvalidateState(ctx, new_state);\r
- _ac_InvalidateState(ctx, new_state);\r
- _tnl_InvalidateState(ctx, new_state);\r
-\r
- swdd->SetReadBuffer = set_read_buffer;\r
+ /* Propogate statechange information to swrast and swrast_setup\r
+ * modules. The DMesa driver has no internal GL-dependent state.\r
+ */\r
+ _swrast_InvalidateState( ctx, new_state );\r
+ _ac_InvalidateState( ctx, new_state );\r
+ _tnl_InvalidateState( ctx, new_state );\r
+ _swsetup_InvalidateState( ctx, new_state );\r
\r
/* RGB(A) span/pixel functions */\r
- swdd->WriteRGBASpan = write_rgba_span;\r
- swdd->WriteRGBSpan = write_rgb_span;\r
- swdd->WriteMonoRGBASpan = write_mono_rgba_span;\r
- swdd->WriteRGBAPixels = write_rgba_pixels;\r
- swdd->WriteMonoRGBAPixels = write_mono_rgba_pixels;\r
- swdd->ReadRGBASpan = read_rgba_span;\r
- swdd->ReadRGBAPixels = read_rgba_pixels;\r
+ dd->WriteRGBASpan = write_rgba_span;\r
+ dd->WriteRGBSpan = write_rgb_span;\r
+ dd->WriteMonoRGBASpan = write_mono_rgba_span;\r
+ dd->WriteRGBAPixels = write_rgba_pixels;\r
+ dd->WriteMonoRGBAPixels = write_mono_rgba_pixels;\r
+ dd->ReadRGBASpan = read_rgba_span;\r
+ dd->ReadRGBAPixels = read_rgba_pixels;\r
}\r
\r
\r
\r
-/**********************************************************************/\r
-/***** DMesa Public API Functions *****/\r
-/**********************************************************************/\r
-\r
-\r
+/****************************************************************************\r
+ * DMesa Public API Functions\r
+ ***************************************************************************/\r
\r
/*\r
* The exact arguments to this function will depend on your window system\r
DMesaVisual v;\r
GLint redBits, greenBits, blueBits, alphaBits;\r
\r
- int refresh;\r
char *var = getenv("DMESA_REFRESH");\r
- if ((var == NULL) || ((refresh=atoi(var)) == 0)) {\r
- refresh = 60;\r
- }\r
+ int refresh = (var != NULL) ? atoi(var) : 0;\r
\r
if (!dbFlag) {\r
return NULL;\r
}\r
+\r
alphaBits = 0;\r
switch (colDepth) {\r
case 15:\r
return NULL;\r
}\r
\r
- if ((v=(DMesaVisual)calloc(1, sizeof(struct dmesa_visual)))!=NULL) {\r
+ if ((v=(DMesaVisual)calloc(1, sizeof(struct dmesa_visual))) != NULL) {\r
/* Create core visual */\r
v->gl_visual = _mesa_create_visual(colDepth>8, /* rgb */\r
dbFlag,\r
{\r
DMesaBuffer b;\r
\r
- if ((b=(DMesaBuffer)calloc(1, sizeof(struct dmesa_buffer)))!=NULL) {\r
+ if ((b=(DMesaBuffer)calloc(1, sizeof(struct dmesa_buffer))) != NULL) {\r
\r
_mesa_initialize_framebuffer(&b->gl_buffer,\r
visual->gl_visual,\r
DMesaContext c;\r
GLboolean direct = GL_FALSE;\r
\r
- if ((c=(DMesaContext)calloc(1, sizeof(struct dmesa_context)))!=NULL) {\r
+ if ((c=(DMesaContext)calloc(1, sizeof(struct dmesa_context))) != NULL) {\r
c->gl_ctx = _mesa_create_context(visual->gl_visual,\r
share ? share->gl_ctx : NULL,\r
(void *)c, direct);\r
_mesa_enable_sw_extensions(c->gl_ctx);\r
_mesa_enable_1_3_extensions(c->gl_ctx);\r
\r
- /* you probably have to do a bunch of other initializations here. */\r
+ /* you probably have to do a bunch of other initializations here. */\r
c->visual = visual;\r
\r
- /* Initialize the software rasterizer and helper modules.\r
- */\r
+ c->gl_ctx->Driver.UpdateState = dmesa_update_state;\r
+\r
+ /* Initialize the software rasterizer and helper modules.\r
+ */\r
_swrast_CreateContext(c->gl_ctx);\r
_ac_CreateContext(c->gl_ctx);\r
_tnl_CreateContext(c->gl_ctx);\r
_swsetup_CreateContext(c->gl_ctx);\r
- dmesa_init_pointers(c->gl_ctx);\r
dmesa_register_swrast_functions(c->gl_ctx);\r
+ dmesa_init_pointers(c->gl_ctx);\r
}\r
\r
return c;\r
{\r
void *new_window;\r
\r
- if ((new_window=vl_sync_buffer(b->the_window, xpos, ypos, width, height))==NULL) {\r
+ if ((new_window=vl_sync_buffer(b->the_window, xpos, ypos, width, height)) == NULL) {\r
return GL_FALSE;\r
} else {\r
b->the_window = new_window;\r
*/\r
GLboolean DMesaMakeCurrent (DMesaContext c, DMesaBuffer b)\r
{\r
- if (c&&b) {\r
+ if ((c != NULL) && (b != NULL)) {\r
if (!DMesaViewport(b, b->xpos, b->ypos, b->width, b->height)) {\r
return GL_FALSE;\r
}\r
\r
c->Buffer = b;\r
\r
- dmesa_update_state(c->gl_ctx, 0);\r
_mesa_make_current(c->gl_ctx, &b->gl_buffer);\r
- if (c->gl_ctx->Viewport.Width==0) {\r
+ if (c->gl_ctx->Viewport.Width == 0) {\r
/* initialize viewport to window size */\r
_mesa_Viewport(0, 0, b->width, b->height);\r
}\r