[1/4] wined3d: Fix GL_ARB_texture_cube_map extension support

H. Verbeet hverbeet at gmail.com
Sat Nov 18 10:07:32 CST 2006


The compile time check for GL_VERSION_1_3 is pretty useless, since the
constants have the same values. The GLTEXTURECUBEMAP #define only
obfuscates the code.

Changelog:
  - Add proper definitions for GL_ARB_texture_cube_map & use them.
-------------- next part --------------
---

 dlls/wined3d/baseshader.c      |    2 +-
 dlls/wined3d/cubetexture.c     |    9 ---------
 dlls/wined3d/drawprim.c        |    4 ++--
 dlls/wined3d/wined3d_private.h |    2 --
 include/wine/wined3d_gl.h      |   18 ++++++++++++++++++
 5 files changed, 21 insertions(+), 14 deletions(-)

diff --git a/dlls/wined3d/baseshader.c b/dlls/wined3d/baseshader.c
index 277edbf..5e157eb 100644
--- a/dlls/wined3d/baseshader.c
+++ b/dlls/wined3d/baseshader.c
@@ -319,7 +319,7 @@ HRESULT shader_get_registers_used(
                             reg_maps->samplers[sampler_code] = (0x1 << 31) | WINED3DSTT_VOLUME;
                             break;
 
-                        case GLTEXTURECUBEMAP:
+                        case GL_TEXTURE_CUBE_MAP_ARB:
                             reg_maps->samplers[sampler_code] = (0x1 << 31) | WINED3DSTT_CUBE;
                             break;
 
diff --git a/dlls/wined3d/cubetexture.c b/dlls/wined3d/cubetexture.c
index c16740a..a55fdb1 100644
--- a/dlls/wined3d/cubetexture.c
+++ b/dlls/wined3d/cubetexture.c
@@ -27,21 +27,12 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3d);
 #define GLINFO_LOCATION ((IWineD3DImpl *)(((IWineD3DDeviceImpl *)This->resource.wineD3DDevice)->wineD3D))->gl_info
 
 static const GLenum cube_targets[6] = {
-#if defined(GL_VERSION_1_3)
-  GL_TEXTURE_CUBE_MAP_POSITIVE_X,
-  GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
-  GL_TEXTURE_CUBE_MAP_POSITIVE_Y,
-  GL_TEXTURE_CUBE_MAP_NEGATIVE_Y,
-  GL_TEXTURE_CUBE_MAP_POSITIVE_Z,
-  GL_TEXTURE_CUBE_MAP_NEGATIVE_Z
-#else
   GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB,
   GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB,
   GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB,
   GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB,
   GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB,
   GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB
-#endif
 };
 
 /* *******************************************
diff --git a/dlls/wined3d/drawprim.c b/dlls/wined3d/drawprim.c
index 8ddb017..7b60054 100644
--- a/dlls/wined3d/drawprim.c
+++ b/dlls/wined3d/drawprim.c
@@ -1940,7 +1940,7 @@ static void drawPrimitiveUploadTexturesP
                 glDisable(GL_TEXTURE_CUBE_MAP_ARB);
                 glDisable(GL_TEXTURE_2D);
                 break;
-            case GLTEXTURECUBEMAP:
+            case GL_TEXTURE_CUBE_MAP_ARB:
                 glDisable(GL_TEXTURE_2D);
                 glDisable(GL_TEXTURE_3D);
                 break;
@@ -2005,7 +2005,7 @@ static void drawPrimitiveUploadTextures(
                     glDisable(GL_TEXTURE_CUBE_MAP_ARB);
                     glDisable(GL_TEXTURE_2D);
                     break;
-                case GLTEXTURECUBEMAP:
+                case GL_TEXTURE_CUBE_MAP_ARB:
                     glDisable(GL_TEXTURE_2D);
                     glDisable(GL_TEXTURE_3D);
                     break;
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 8b0a315..00fe8d5 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -215,8 +215,6 @@ #define D3DCOLORTOGLFLOAT4(dw, vec) \
   (vec)[2] = D3DCOLOR_B(dw); \
   (vec)[3] = D3DCOLOR_A(dw);
 
-#define GLTEXTURECUBEMAP GL_TEXTURE_CUBE_MAP_ARB
-
 /* DirectX Device Limits */
 /* --------------------- */
 #define MAX_LEVELS  256  /* Maximum number of mipmap levels. Guessed at 256 */
diff --git a/include/wine/wined3d_gl.h b/include/wine/wined3d_gl.h
index c3b4528..0e48f5a 100644
--- a/include/wine/wined3d_gl.h
+++ b/include/wine/wined3d_gl.h
@@ -208,6 +208,24 @@ typedef void (APIENTRY *WINED3D_PFNGLMUL
 typedef void (APIENTRY *WINED3D_PFNGLMULTITEXCOORD2FARBPROC) (GLenum target, GLfloat s, GLfloat t);
 typedef void (APIENTRY *WINED3D_PFNGLMULTITEXCOORD3FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r);
 typedef void (APIENTRY *WINED3D_PFNGLMULTITEXCOORD4FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q);
+
+/* GL_ARB_texture_cube_map */
+#ifndef GL_ARB_texture_cube_map
+#define GL_ARB_texture_cube_map 1
+#define GL_NORMAL_MAP_ARB                   0x8511
+#define GL_REFLECTION_MAP_ARB               0x8512
+#define GL_TEXTURE_CUBE_MAP_ARB             0x8513
+#define GL_TEXTURE_BINDING_CUBE_MAP_ARB     0x8514
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB  0x8515
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB  0x8516
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB  0x8517
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB  0x8518
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB  0x8519
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB  0x851A
+#define GL_PROXY_TEXTURE_CUBE_MAP_ARB       0x851B
+#define GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB    0x851C
+#endif
+
 /* GL_ARB_point_parameters */
 #ifndef GL_ARB_point_parameters
 #define GL_ARB_point_parameters 1


More information about the wine-patches mailing list