[dx51] better caps code and fix last seen compilations problems

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

 



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi all,

 I just come back to home and i can see a flood of message (maybe i see too 
many after too many drinks) ;(

 This patch must fix many of your problems with d3d8 compilation (why we can't 
have propers gl headers installed ? ;-( )
 
  I have tested it with headers from Eric Pouech, Rein Klazes and some others 
from net (nvidia, mesa, ...). 

  So please jason, can you complete the d3dcore_gl header to add the 
extensions definition you use and use it without using #ifdef/#endif (as i 
have done for dot3 support for exemple)

Regards,
Raphael
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)

iD8DBQE+3/KVp7NA3AmQTU4RAje9AKCaObWsCJN9VUgHKkqHO9bgnhRdFACeOSax
borIBnW8hkm7BRggGH2hNJE=
=S+Tc
-----END PGP SIGNATURE-----
Index: d3d8_private.h
===================================================================
RCS file: /home/wine/wine/dlls/d3d8/d3d8_private.h,v
retrieving revision 1.34
diff -u -r1.34 d3d8_private.h
--- d3d8_private.h	4 Jun 2003 23:05:46 -0000	1.34
+++ d3d8_private.h	6 Jun 2003 01:36:07 -0000
@@ -194,8 +194,10 @@
   
   BOOL supported[30];
 
-  /** ext functions ptr */
+  /** OpenGL EXT and ARB functions ptr */
   GL_EXT_FUNCS_GEN;
+  /** OpenGL GLX functions ptr */
+  GLX_EXT_FUNCS_GEN;
   /**/
 } GL_Info;
 #undef USE_GL_FUNC
Index: d3dcore_gl.h
===================================================================
RCS file: /home/wine/wine/dlls/d3d8/d3dcore_gl.h,v
retrieving revision 1.1
diff -u -r1.1 d3dcore_gl.h
--- d3dcore_gl.h	4 Jun 2003 23:01:49 -0000	1.1
+++ d3dcore_gl.h	6 Jun 2003 01:36:08 -0000
@@ -33,16 +33,11 @@
 #endif
 #undef  XMD_H
 
-#undef APIENTRY
-#undef CALLBACK
-#undef WINAPI
-
-/* Redefines the constants */
-#define CALLBACK    __stdcall
-#define WINAPI      __stdcall
-#define APIENTRY    WINAPI
-
 
+/*******
+ * OpenGL Extensions (EXT and ARB)
+ *  defines and functions pointer
+ */
 
 /* GL_EXT_secondary_color */
 #ifndef GL_EXT_secondary_color
@@ -54,11 +49,11 @@
 #define GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT  0x845C
 #define GL_SECONDARY_COLOR_ARRAY_POINTER_EXT 0x845D
 #define GL_SECONDARY_COLOR_ARRAY_EXT         0x845E
-typedef void (APIENTRY * PFNGLSECONDARYCOLOR3FEXTPROC) (GLfloat red, GLfloat green, GLfloat blue);
-typedef void (APIENTRY * PFNGLSECONDARYCOLOR3FVEXTPROC) (const GLfloat *v);
-typedef void (APIENTRY * PFNGLSECONDARYCOLOR3UBEXTPROC) (GLubyte red, GLubyte green, GLubyte blue);
-typedef void (APIENTRY * PFNGLSECONDARYCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
 #endif
+typedef void (APIENTRY * PGLFNGLSECONDARYCOLOR3FEXTPROC) (GLfloat red, GLfloat green, GLfloat blue);
+typedef void (APIENTRY * PGLFNGLSECONDARYCOLOR3FVEXTPROC) (const GLfloat *v);
+typedef void (APIENTRY * PGLFNGLSECONDARYCOLOR3UBEXTPROC) (GLubyte red, GLubyte green, GLubyte blue);
+typedef void (APIENTRY * PGLFNGLSECONDARYCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
 /* GL_EXT_paletted_texture */
 #ifndef GL_EXT_paletted_texture
 #define GL_EXT_paletted_texture 1
@@ -69,8 +64,8 @@
 #define GL_COLOR_INDEX12_EXT              0x80E6
 #define GL_COLOR_INDEX16_EXT              0x80E7
 #define GL_TEXTURE_INDEX_SIZE_EXT         0x80ED
-typedef void (APIENTRY * PFNGLCOLORTABLEEXTPROC) (GLenum target, GLenum internalFormat, GLsizei width, GLenum format, GLenum type, const GLvoid *table);
 #endif
+typedef void (APIENTRY * PGLFNGLCOLORTABLEEXTPROC) (GLenum target, GLenum internalFormat, GLsizei width, GLenum format, GLenum type, const GLvoid *table);
 /* GL_EXT_point_parameters */
 #ifndef GL_EXT_point_parameters
 #define GL_EXT_point_parameters 1
@@ -78,11 +73,113 @@
 #define GL_POINT_SIZE_MAX_EXT             0x8127
 #define GL_POINT_FADE_THRESHOLD_SIZE_EXT  0x8128
 #define GL_DISTANCE_ATTENUATION_EXT       0x8129
-typedef void (APIENTRY * PFNGLPOINTPARAMETERFEXTPROC) (GLenum pname, GLfloat param);
-typedef void (APIENTRY * PFNGLPOINTPARAMETERFVEXTPROC) (GLenum pname, const GLfloat *params);
+#endif
+typedef void (APIENTRY * PGLFNGLPOINTPARAMETERFEXTPROC) (GLenum pname, GLfloat param);
+typedef void (APIENTRY * PGLFNGLPOINTPARAMETERFVEXTPROC) (GLenum pname, const GLfloat *params);
+#ifndef GL_EXT_texture_env_combine
+#define GL_EXT_texture_env_combine 1
+#define GL_COMBINE_EXT                    0x8570
+#define GL_COMBINE_RGB_EXT                0x8571
+#define GL_COMBINE_ALPHA_EXT              0x8572
+#define GL_RGB_SCALE_EXT                  0x8573
+#define GL_ADD_SIGNED_EXT                 0x8574
+#define GL_INTERPOLATE_EXT                0x8575
+#define GL_SUBTRACT_EXT                   0x84E7
+#define GL_CONSTANT_EXT                   0x8576
+#define GL_PRIMARY_COLOR_EXT              0x8577
+#define GL_PREVIOUS_EXT                   0x8578
+#define GL_SOURCE0_RGB_EXT                0x8580
+#define GL_SOURCE1_RGB_EXT                0x8581
+#define GL_SOURCE2_RGB_EXT                0x8582
+#define GL_SOURCE3_RGB_EXT                0x8583
+#define GL_SOURCE4_RGB_EXT                0x8584
+#define GL_SOURCE5_RGB_EXT                0x8585
+#define GL_SOURCE6_RGB_EXT                0x8586
+#define GL_SOURCE7_RGB_EXT                0x8587
+#define GL_SOURCE0_ALPHA_EXT              0x8588
+#define GL_SOURCE1_ALPHA_EXT              0x8589
+#define GL_SOURCE2_ALPHA_EXT              0x858A
+#define GL_SOURCE3_ALPHA_EXT              0x858B
+#define GL_SOURCE4_ALPHA_EXT              0x858C
+#define GL_SOURCE5_ALPHA_EXT              0x858D
+#define GL_SOURCE6_ALPHA_EXT              0x858E
+#define GL_SOURCE7_ALPHA_EXT              0x858F
+#define GL_OPERAND0_RGB_EXT               0x8590
+#define GL_OPERAND1_RGB_EXT               0x8591
+#define GL_OPERAND2_RGB_EXT               0x8592
+#define GL_OPERAND3_RGB_EXT               0x8593
+#define GL_OPERAND4_RGB_EXT               0x8594
+#define GL_OPERAND5_RGB_EXT               0x8595
+#define GL_OPERAND6_RGB_EXT               0x8596
+#define GL_OPERAND7_RGB_EXT               0x8597
+#define GL_OPERAND0_ALPHA_EXT             0x8598
+#define GL_OPERAND1_ALPHA_EXT             0x8599
+#define GL_OPERAND2_ALPHA_EXT             0x859A
+#define GL_OPERAND3_ALPHA_EXT             0x859B
+#define GL_OPERAND4_ALPHA_EXT             0x859C
+#define GL_OPERAND5_ALPHA_EXT             0x859D
+#define GL_OPERAND6_ALPHA_EXT             0x859E
+#define GL_OPERAND7_ALPHA_EXT             0x859F
+#endif
+/* GL_EXT_texture_env_dot3 */
+#ifndef GL_EXT_texture_env_dot3
+#define GL_EXT_texture_env_dot3 1
+#define GL_DOT3_RGB_EXT			  0x8740
+#define GL_DOT3_RGBA_EXT		  0x8741
+#endif
+
+
+/*******
+ * OpenGL Official Version 
+ *  defines 
+ */
+
+/* GL_VERSION_1_3 */
+#if !defined(GL_DOT3_RGBA)
+# define GL_DOT3_RGBA                     0x8741
+#endif
+#if !defined(GL_SUBTRACT)
+# define GL_SUBTRACT                      0x84E7
 #endif
 
 
+/*******
+ * OpenGL GLX Extensions
+ *  defines and functions pointer
+ */
+
+
+
+/*******
+ * OpenGL GLX Official Version
+ *  defines and functions pointer
+ */
+
+/* GLX_VERSION_1_3 */
+typedef GLXFBConfig * (APIENTRY * PGLXFNGLXGETFBCONFIGSPROC) (Display *dpy, int screen, int *nelements);
+typedef GLXFBConfig * (APIENTRY * PGLXFNGLXCHOOSEFBCONFIGPROC) (Display *dpy, int screen, const int *attrib_list, int *nelements);
+typedef int           (APIENTRY * PGLXFNGLXGETFBCONFIGATTRIBPROC) (Display *dpy, GLXFBConfig config, int attribute, int *value);
+typedef XVisualInfo * (APIENTRY * PGLXFNGLXGETVISUALFROMFBCONFIGPROC) (Display *dpy, GLXFBConfig config);
+typedef GLXWindow     (APIENTRY * PGLXFNGLXCREATEWINDOWPROC) (Display *dpy, GLXFBConfig config, Window win, const int *attrib_list);
+typedef void          (APIENTRY * PGLXFNGLXDESTROYWINDOWPROC) (Display *dpy, GLXWindow win);
+typedef GLXPixmap     (APIENTRY * PGLXFNGLXCREATEPIXMAPPROC) (Display *dpy, GLXFBConfig config, Pixmap pixmap, const int *attrib_list);
+typedef void          (APIENTRY * PGLXFNGLXDESTROYPIXMAPPROC) (Display *dpy, GLXPixmap pixmap);
+typedef GLXPbuffer    (APIENTRY * PGLXFNGLXCREATEPBUFFERPROC) (Display *dpy, GLXFBConfig config, const int *attrib_list);
+typedef void          (APIENTRY * PGLXFNGLXDESTROYPBUFFERPROC) (Display *dpy, GLXPbuffer pbuf);
+typedef void          (APIENTRY * PGLXFNGLXQUERYDRAWABLEPROC) (Display *dpy, GLXDrawable draw, int attribute, unsigned int *value);
+typedef GLXContext    (APIENTRY * PGLXFNGLXCREATENEWCONTEXTPROC) (Display *dpy, GLXFBConfig config, int render_type, GLXContext share_list, Bool direct);
+typedef Bool          (APIENTRY * PGLXFNGLXMAKECONTEXTCURRENTPROC) (Display *dpy, GLXDrawable draw, GLXDrawable read, GLXContext ctx);
+typedef GLXDrawable   (APIENTRY * PGLXFNGLXGETCURRENTREADDRAWABLEPROC) (void);
+typedef Display *     (APIENTRY * PGLXFNGLXGETCURRENTDISPLAYPROC) (void);
+typedef int           (APIENTRY * PGLXFNGLXQUERYCONTEXTPROC) (Display *dpy, GLXContext ctx, int attribute, int *value);
+typedef void          (APIENTRY * PGLXFNGLXSELECTEVENTPROC) (Display *dpy, GLXDrawable draw, unsigned long event_mask);
+typedef void          (APIENTRY * PGLXFNGLXGETSELECTEDEVENTPROC) (Display *dpy, GLXDrawable draw, unsigned long *event_mask);
+
+
+/*******
+ * OpenGL Supported Extensions (ARB and EXT)
+ */
+
 typedef enum _GL_SupportedExt {
   /* ARB */
   ARB_FRAGMENT_PROGRAM,
@@ -91,6 +188,7 @@
   ARB_POINT_PARAMETERS,
   ARB_TEXTURE_COMPRESSION,
   ARB_TEXTURE_CUBE_MAP,
+  ARB_TEXTURE_ENV_COMBINE,
   ARB_TEXTURE_ENV_DOT3,
   ARB_VERTEX_PROGRAM,
   ARB_VERTEX_BLEND,
@@ -136,18 +234,38 @@
   PS_VERSION_FORCE_DWORD = 0x7FFFFFFF
 } GL_PSVersion;
 
+
 #define GL_EXT_FUNCS_GEN \
     /** EXT Extensions **/ \
     /* GL_EXT_fog_coord */ \
     /* GL_EXT_paletted_texture */ \
-    USE_GL_FUNC(PFNGLCOLORTABLEEXTPROC,            glColorTableEXT); \
+    USE_GL_FUNC(PGLFNGLCOLORTABLEEXTPROC,            glColorTableEXT); \
     /* GL_EXT_point_parameters */ \
-    USE_GL_FUNC(PFNGLPOINTPARAMETERFEXTPROC,       glPointParameterfEXT); \
-    USE_GL_FUNC(PFNGLPOINTPARAMETERFVEXTPROC,      glPointParameterfvEXT); \
+    USE_GL_FUNC(PGLFNGLPOINTPARAMETERFEXTPROC,       glPointParameterfEXT); \
+    USE_GL_FUNC(PGLFNGLPOINTPARAMETERFVEXTPROC,      glPointParameterfvEXT); \
     /* GL_EXT_secondary_color */ \
-    USE_GL_FUNC(PFNGLSECONDARYCOLOR3UBEXTPROC,     glSecondaryColor3ubEXT); \
-    USE_GL_FUNC(PFNGLSECONDARYCOLOR3FEXTPROC,      glSecondaryColor3fEXT); \
-    USE_GL_FUNC(PFNGLSECONDARYCOLOR3FVEXTPROC,     glSecondaryColor3fvEXT); \
-    USE_GL_FUNC(PFNGLSECONDARYCOLORPOINTEREXTPROC, glSecondaryColorPointerEXT); \
+    USE_GL_FUNC(PGLFNGLSECONDARYCOLOR3UBEXTPROC,     glSecondaryColor3ubEXT); \
+    USE_GL_FUNC(PGLFNGLSECONDARYCOLOR3FEXTPROC,      glSecondaryColor3fEXT); \
+    USE_GL_FUNC(PGLFNGLSECONDARYCOLOR3FVEXTPROC,     glSecondaryColor3fvEXT); \
+    USE_GL_FUNC(PGLFNGLSECONDARYCOLORPOINTEREXTPROC, glSecondaryColorPointerEXT); \
+
+#define GLX_EXT_FUNCS_GEN \
+    /** GLX_VERSION_1_3 **/ \
+    USE_GL_FUNC(PGLXFNGLXCREATEPBUFFERPROC,          glXCreatePbuffer); \
+    USE_GL_FUNC(PGLXFNGLXDESTROYPBUFFERPROC,         glXDestroyPbuffer); \
+    USE_GL_FUNC(PGLXFNGLXCREATEPIXMAPPROC,           glXCreatePixmap); \
+    USE_GL_FUNC(PGLXFNGLXDESTROYPIXMAPPROC,          glXDestroyPixmap); \
+    USE_GL_FUNC(PGLXFNGLXCREATENEWCONTEXTPROC,       glXCreateNewContext); \
+    USE_GL_FUNC(PGLXFNGLXMAKECONTEXTCURRENTPROC,     glXMakeContextCurrent); \
+    USE_GL_FUNC(PGLXFNGLXCHOOSEFBCONFIGPROC,         glXChooseFBConfig); \
+
+#undef APIENTRY
+#undef CALLBACK
+#undef WINAPI
+
+/* Redefines the constants */
+#define CALLBACK    __stdcall
+#define WINAPI      __stdcall
+#define APIENTRY    WINAPI
 
 #endif  /* __WINE_D3DCORE_GL_H */
Index: device.c
===================================================================
RCS file: /home/wine/wine/dlls/d3d8/device.c,v
retrieving revision 1.69
diff -u -r1.69 device.c
--- device.c	4 Jun 2003 23:05:46 -0000	1.69
+++ device.c	6 Jun 2003 01:36:20 -0000
@@ -34,8 +34,6 @@
 /*#define GL_GLEXT_PROTOTYPES*/
 /*#undef  GLX_GLXEXT_LEGACY*/
 #include "d3d8_private.h"
-#include <GL/glext.h>
-#include <GL/glxext.h>
 
 /** currently desactiving 1_4 support as mesa doesn't implement all 1_4 support while defining it */
 #undef GL_VERSION_1_4
Index: directx.c
===================================================================
RCS file: /home/wine/wine/dlls/d3d8/directx.c,v
retrieving revision 1.42
diff -u -r1.42 directx.c
--- directx.c	4 Jun 2003 23:05:46 -0000	1.42
+++ directx.c	6 Jun 2003 01:36:23 -0000
@@ -600,7 +600,7 @@
 
     pCaps->MaxPrimitiveCount = 0xFFFFFFFF;
     pCaps->MaxVertexIndex = 0xFFFFFFFF;
-    pCaps->MaxStreams = 2; /* HACK: Some games want at least 2 */ 
+    pCaps->MaxStreams = MAX_STREAMS;
     pCaps->MaxStreamStride = 1024;
 
 #if 1
@@ -698,9 +698,14 @@
         } else if (strcmp(ThisExtn, "GL_ARB_texture_compression") == 0) {
 	  FIXME(" FOUND: ARB Texture Compression support\n");
 	  This->gl_info.supported[ARB_TEXTURE_COMPRESSION] = TRUE;
+        } else if (strcmp(ThisExtn, "GL_ARB_texture_env_combine") == 0) {
+	  FIXME(" FOUND: EXT Texture Env combine support\n");
+	  This->gl_info.supported[ARB_TEXTURE_ENV_COMBINE] = TRUE;
         } else if (strcmp(ThisExtn, "GL_ARB_texture_env_dot3") == 0) {
-	  FIXME(" FOUND: EXT Dot3 support\n");
-	  This->gl_info.supported[ARB_TEXTURE_ENV_DOT3] = TRUE;
+	  if (FALSE == This->gl_info.supported[ARB_TEXTURE_ENV_DOT3]) {
+	    FIXME(" FOUND: EXT Dot3 support\n");
+	    This->gl_info.supported[ARB_TEXTURE_ENV_DOT3] = TRUE;
+	  }
 	} else if (strstr(ThisExtn, "GL_ARB_vertex_program")) {
 	  This->gl_info.vs_arb_version = VS_VERSION_11;
 	  FIXME(" FOUND: ARB Vertex Shader support - version=%02x\n", This->gl_info.vs_arb_version);
@@ -724,6 +729,11 @@
 	} else if (strcmp(ThisExtn, "GL_EXT_texture_compression_s3tc") == 0) {
 	  FIXME(" FOUND: EXT Texture S3TC compression support\n");
 	  This->gl_info.supported[EXT_TEXTURE_COMPRESSION_S3TC] = TRUE;
+        } else if (strcmp(ThisExtn, "GL_EXT_texture_env_dot3") == 0) {
+	  if (FALSE == This->gl_info.supported[ARB_TEXTURE_ENV_DOT3]) {
+	    FIXME(" FOUND: EXT Dot3 support\n");
+	    This->gl_info.supported[ARB_TEXTURE_ENV_DOT3] = TRUE;
+	  }
 	} else if (strcmp(ThisExtn, "GL_EXT_texture_filter_anisotropic") == 0) {
 	  FIXME(" FOUND: EXT Texture Anisotropic filter support\n");
 	  This->gl_info.supported[EXT_TEXTURE_FILTER_ANISOTROPIC] = TRUE;
@@ -788,6 +798,11 @@
         if (*GLX_Extensions == ' ') GLX_Extensions++;
       }
     }
+
+#define USE_GL_FUNC(type, pfn) This->gl_info.pfn = (type) glXGetProcAddressARB(#pfn);
+    GLX_EXT_FUNCS_GEN;
+#undef USE_GL_FUNC
+
 }
 
 HRESULT  WINAPI  IDirect3D8Impl_CreateDevice               (LPDIRECT3D8 iface,
Index: utils.c
===================================================================
RCS file: /home/wine/wine/dlls/d3d8/utils.c,v
retrieving revision 1.4
diff -u -r1.4 utils.c
--- utils.c	4 Jun 2003 22:20:47 -0000	1.4
+++ utils.c	6 Jun 2003 01:36:25 -0000
@@ -536,16 +536,16 @@
 
 /* Set texture operations up - The following avoids lots of ifdefs in this routine!*/
 #if defined (GL_VERSION_1_3)
-  #define useext(A) A
-  #define combine_ext 1
+# define useext(A) A
+# define combine_ext 1
 #elif defined (GL_EXT_texture_env_combine)
-  #define useext(A) A##_EXT
-  #define combine_ext 1
+# define useext(A) A##_EXT
+# define combine_ext 1
 #elif defined (GL_ARB_texture_env_combine)
-  #define useext(A) A##_ARB
-  #define combine_ext 1
+# define useext(A) A##_ARB
+# define combine_ext 1
 #else
-  #undef combine_ext
+# undef combine_ext
 #endif
 
 #if !defined(combine_ext)
@@ -579,7 +579,7 @@
 		opr0_target = useext(GL_OPERAND0_ALPHA);
 		opr1_target = useext(GL_OPERAND1_ALPHA);
 		opr2_target = useext(GL_OPERAND2_ALPHA);
-		scal_target = useext(GL_ALPHA_SCALE);
+		scal_target = GL_ALPHA_SCALE;
 	}
 	else {
 		comb_target = useext(GL_COMBINE_RGB);
@@ -713,8 +713,8 @@
 		checkGLcall("GL_TEXTURE_ENV, scal_target, 2");
 		break;
         case D3DTOP_SUBTRACT:
-#if defined(GL_VERSION_1_3) || defined (GL_ARB_texture_env_combine)
-		glTexEnvi(GL_TEXTURE_ENV, comb_target, useext(GL_SUBTRACT));
+	  if (GL_SUPPORT(ARB_TEXTURE_ENV_COMBINE)) {
+		glTexEnvi(GL_TEXTURE_ENV, comb_target, GL_SUBTRACT);
 		checkGLcall("GL_TEXTURE_ENV, comb_target, useext(GL_SUBTRACT)");
 		glTexEnvi(GL_TEXTURE_ENV, src0_target, src1);
 		checkGLcall("GL_TEXTURE_ENV, src0_target, src1");
@@ -726,10 +726,11 @@
 		checkGLcall("GL_TEXTURE_ENV, opr1_target, opr2");
 		glTexEnvi(GL_TEXTURE_ENV, scal_target, 1);
 		checkGLcall("GL_TEXTURE_ENV, scal_target, 1");
-#else
+	  } else {
                 FIXME("This version of opengl does not support GL_SUBTRACT\n");
-#endif
-		break;
+	  }
+	  break;
+
 	case D3DTOP_BLENDDIFFUSEALPHA:
 		glTexEnvi(GL_TEXTURE_ENV, comb_target, useext(GL_INTERPOLATE));
 		checkGLcall("GL_TEXTURE_ENV, comb_target, useext(GL_INTERPOLATE)");
@@ -741,7 +742,7 @@
 		checkGLcall("GL_TEXTURE_ENV, src1_target, src2");
 		glTexEnvi(GL_TEXTURE_ENV, opr1_target, opr2);
 		checkGLcall("GL_TEXTURE_ENV, opr1_target, opr2");
-		glTexEnvi(GL_TEXTURE_ENV, src2_target, GL_PRIMARY_COLOR);
+		glTexEnvi(GL_TEXTURE_ENV, src2_target, useext(GL_PRIMARY_COLOR));
 		checkGLcall("GL_TEXTURE_ENV, src2_target, GL_PRIMARY_COLOR");
 		glTexEnvi(GL_TEXTURE_ENV, opr2_target, GL_SRC_ALPHA);
 		checkGLcall("GL_TEXTURE_ENV, opr2_target, GL_SRC_ALPHA");
@@ -777,7 +778,7 @@
 		checkGLcall("GL_TEXTURE_ENV, src1_target, src2");
 		glTexEnvi(GL_TEXTURE_ENV, opr1_target, opr2);
 		checkGLcall("GL_TEXTURE_ENV, opr1_target, opr2");
-		glTexEnvi(GL_TEXTURE_ENV, src2_target, GL_CONSTANT);
+		glTexEnvi(GL_TEXTURE_ENV, src2_target, useext(GL_CONSTANT));
 		checkGLcall("GL_TEXTURE_ENV, src2_target, GL_CONSTANT");
 		glTexEnvi(GL_TEXTURE_ENV, opr2_target, GL_SRC_ALPHA);
 		checkGLcall("GL_TEXTURE_ENV, opr2_target, GL_SRC_ALPHA");
@@ -795,7 +796,7 @@
 		checkGLcall("GL_TEXTURE_ENV, src1_target, src2");
 		glTexEnvi(GL_TEXTURE_ENV, opr1_target, opr2);
 		checkGLcall("GL_TEXTURE_ENV, opr1_target, opr2");
-		glTexEnvi(GL_TEXTURE_ENV, src2_target, GL_PREVIOUS);
+		glTexEnvi(GL_TEXTURE_ENV, src2_target, useext(GL_PREVIOUS));
 		checkGLcall("GL_TEXTURE_ENV, src2_target, GL_PREVIOUS");
 		glTexEnvi(GL_TEXTURE_ENV, opr2_target, GL_SRC_ALPHA);
 		checkGLcall("GL_TEXTURE_ENV, opr2_target, GL_SRC_ALPHA");
@@ -803,18 +804,12 @@
 		checkGLcall("GL_TEXTURE_ENV, scal_target, 1");
 		break;
         case D3DTOP_DOTPRODUCT3: 
-#if defined(GL_EXT_texture_env_dot3) 
-		glTexEnvi(GL_TEXTURE_ENV, comb_target, GL_DOT3_RGBA_EXT);
-		checkGLcall("GL_TEXTURE_ENV, comb_target, GL_DOT3_RGBA_EXT");
-#elif defined(GL_ARB_texture_env_dot3)
-		glTexEnvi(GL_TEXTURE_ENV, comb_target, GL_DOT3_RGBA_ARB);
-		checkGLcall("GL_TEXTURE_ENV, comb_target, GL_DOT3_RGBA_ARB");
-#elif defined (GL_VERSION_1_3)
-		glTexEnvi(GL_TEXTURE_ENV, comb_target, GL_DOT3_RGBA);
-		checkGLcall("GL_TEXTURE_ENV, comb_target, GL_DOT3_RGBA");
-#else
-                FIXME("This version of opengl does not support GL_DOT3\n");
-#endif
+	       if (GL_SUPPORT(ARB_TEXTURE_ENV_DOT3)) {
+		  glTexEnvi(GL_TEXTURE_ENV, comb_target, GL_DOT3_RGBA);
+		  checkGLcall("GL_TEXTURE_ENV, comb_target, GL_DOT3_RGBA");
+		} else {
+		  FIXME("This version of opengl does not support GL_DOT3\n");
+		}
 		glTexEnvi(GL_TEXTURE_ENV, src0_target, src1);
 		checkGLcall("GL_TEXTURE_ENV, src0_target, src1");
 		glTexEnvi(GL_TEXTURE_ENV, opr0_target, opr1);

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

  Powered by Linux