[D3D 46] Handle texture addressing modes in D3D7

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Changelog:
 Handle texture addressing the D3D7 way

-- 
		 Lionel Ulmer - http://www.bbrox.org/
--- /home/ulmer/Wine/wine_base//dlls/ddraw/d3ddevice/mesa.c	2002-12-24 18:11:39.000000000 +0100
+++ /home/ulmer/Wine/wine_work//dlls/ddraw/d3ddevice/mesa.c	2002-12-24 18:09:44.000000000 +0100
@@ -1324,6 +1324,24 @@
 	    glThis->render_state.mag = gl_state;
 	    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, gl_state);
             break;
+
+        case D3DTSS_ADDRESS:
+        case D3DTSS_ADDRESSU:
+        case D3DTSS_ADDRESSV: {
+	    GLenum arg = GL_REPEAT; /* Default value */
+	    switch ((D3DTEXTUREADDRESS) dwState) {
+	        case D3DTADDRESS_WRAP:   if (TRACE_ON(ddraw)) DPRINTF("D3DTADDRESS_WRAP\n"); arg = GL_REPEAT; break;
+	        case D3DTADDRESS_CLAMP:  if (TRACE_ON(ddraw)) DPRINTF("D3DTADDRESS_CLAMP\n"); arg = GL_CLAMP; break;
+	        case D3DTADDRESS_BORDER: if (TRACE_ON(ddraw)) DPRINTF("D3DTADDRESS_BORDER\n"); arg = GL_CLAMP_TO_EDGE; break;
+	        default: ERR("Unhandled TEXTUREADDRESS mode %ld !\n", dwState);
+	    }
+	    if ((d3dTexStageStateType == D3DTSS_ADDRESS) ||
+		(d3dTexStageStateType == D3DTSS_ADDRESSU))
+	        glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, arg);
+	    if ((d3dTexStageStateType == D3DTSS_ADDRESS) ||
+		(d3dTexStageStateType == D3DTSS_ADDRESSV))
+	        glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, arg);
+        } break;
 	    
 	default:
 	    if (TRACE_ON(ddraw)) DPRINTF(" unhandled.\n");

[Index of Archives]     [Gimp for Windows]     [Red Hat]     [Samba]     [Yosemite Camping]     [Graphics Cards]     [Wine Home]

  Powered by Linux