Use the faster span read/write template for 16bpp
[mesa.git] / src / mesa / drivers / dos / dmesa.c
index 41e0f4d8b3118c16f37a2165d707de1730b207b1..9688dd95b26fb772051d03580392618b8880b6bc 100644 (file)
@@ -36,6 +36,7 @@
 #include "imports.h"
 #ifndef FX
 #include "bufferobj.h"
+#include "buffers.h"
 #include "extensions.h"
 #include "macros.h"
 #include "matrix.h"
@@ -62,7 +63,7 @@
 #include "GL/dmesa.h"
 
 
-#define SWTC 1 /* SW texture compression */
+#define SWTC 0 /* SW texture compression */
 
 
 /*
@@ -812,6 +813,14 @@ get_buffer_size (GLframebuffer *buffer, GLuint *width, GLuint *height)
 }
 
 
+static void
+viewport(GLcontext *ctx, GLint x, GLint y, GLsizei w, GLsizei h)
+{
+   /* poll for window size change and realloc software Z/stencil/etc if needed */
+   _mesa_ResizeBuffersMESA();
+}
+
+
 static const GLubyte *
 get_string (GLcontext *ctx, GLenum name)
 {
@@ -898,6 +907,7 @@ dmesa_init_driver_functions (DMesaVisual visual,
    driver->UpdateState = dmesa_update_state;
    driver->GetString = get_string;
    driver->GetBufferSize = get_buffer_size;
+   driver->Viewport = viewport;
    driver->Flush = flush;
    driver->Finish = finish;
    driver->Clear = clear;
@@ -1271,11 +1281,8 @@ DMesaMakeCurrent (DMesaContext c, DMesaBuffer b)
       c->buffer = b;
 
       _mesa_make_current((GLcontext *)c, (GLframebuffer *)b);
-      if (((GLcontext *)c)->Viewport.Width == 0) {
-         /* initialize viewport to window size */
-         _mesa_Viewport(0, 0, b->width, b->height);
-      }
-   } else {
+   }
+   else {
       /* Detach */
       _mesa_make_current(NULL, NULL);
    }
@@ -1344,10 +1351,10 @@ DMesaGetCurrentBuffer (void)
 }
 
 
-void *
+DMesaProc
 DMesaGetProcAddress (const char *name)
 {
-   void *p = (void *)_glapi_get_proc_address(name);
+   DMesaProc p = (DMesaProc)_glapi_get_proc_address(name);
 
    /* TODO: handle DMesa* namespace
    if (p == NULL) {
@@ -1404,7 +1411,7 @@ DMesaGetIntegerv (GLenum pname, GLint *params)
 }
 
 
-#if (((__DJGPP__ << 8) | __DJGPP_MINOR__) >= 0x204) && USE_EXTERNAL_DXTN_LIB
+#if SWTC && (((__DJGPP__ << 8) | __DJGPP_MINOR__) >= 0x204)
 #include <sys/dxe.h>
 
 extern_asm(___dj_assert);