Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
54e5f9c4
Commit
54e5f9c4
authored
May 25, 2006
by
Roderick Colenbrander
Committed by
Alexandre Julliard
May 25, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Dynamicly load GL_ARB_multitexture functions.
parent
5b8b7764
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
81 additions
and
51 deletions
+81
-51
device.c
dlls/wined3d/device.c
+4
-2
drawprim.c
dlls/wined3d/drawprim.c
+16
-15
stateblock.c
dlls/wined3d/stateblock.c
+2
-1
surface.c
dlls/wined3d/surface.c
+6
-1
wined3d_private.h
dlls/wined3d/wined3d_private.h
+1
-32
wined3d_gl.h
include/wine/wined3d_gl.h
+52
-0
No files found.
dlls/wined3d/device.c
View file @
54e5f9c4
...
...
@@ -243,7 +243,8 @@ void WINAPI IWineD3DDeviceImpl_SetupTextureStates(IWineD3DDevice *iface, DWORD S
VTRACE
((
"Activating appropriate texture state %ld
\n
"
,
Sampler
));
if
(
GL_SUPPORT
(
ARB_MULTITEXTURE
))
{
ENTER_GL
();
GLACTIVETEXTURE
(
Sampler
);
GL_EXTCALL
(
glActiveTextureARB
(
GL_TEXTURE0_ARB
+
Sampler
));
checkGLcall
(
"glActiveTextureARB"
);
LEAVE_GL
();
/* Could we use bindTexture and then apply the states instead of GLACTIVETEXTURE */
}
else
if
(
Sampler
>
0
)
{
...
...
@@ -3358,7 +3359,8 @@ HRESULT WINAPI IWineD3DDeviceImpl_SetRenderState(IWineD3DDevice *iface, D3DRENDE
/* Note the D3DRS value applies to all textures, but GL has one
per texture, so apply it now ready to be used! */
if
(
GL_SUPPORT
(
ARB_MULTITEXTURE
))
{
GLACTIVETEXTURE
(
i
);
GL_EXTCALL
(
glActiveTextureARB
(
GL_TEXTURE0_ARB
+
i
));
checkGLcall
(
"glActiveTextureARB"
);
}
else
if
(
i
>
0
)
{
FIXME
(
"Program using multiple concurrent textures which this opengl implementation doesn't support
\n
"
);
}
...
...
dlls/wined3d/drawprim.c
View file @
54e5f9c4
...
...
@@ -1185,28 +1185,28 @@ static void loadVertexData(IWineD3DDevice *iface, WineDirect3DVertexStridedData
/* Texture coords -------------------------------------------*/
for
(
textureNo
=
0
;
textureNo
<
GL_LIMITS
(
textures
);
++
textureNo
)
{
/* The code below uses glClientActiveTexture and glMultiTexCoord* which are all part of the GL_ARB_multitexture extension. */
/* Abort if we don't support the extension. */
if
(
!
GL_SUPPORT
(
ARB_MULTITEXTURE
))
{
FIXME
(
"Program using multiple concurrent textures which this opengl implementation doesn't support
\n
"
);
continue
;
}
/* Select the correct texture stage */
GL
CLIENTACTIVETEXTURE
(
textureNo
);
GL
_EXTCALL
(
glClientActiveTextureARB
(
textureNo
)
);
if
(
This
->
stateBlock
->
textures
[
textureNo
]
!=
NULL
)
{
int
coordIdx
=
This
->
stateBlock
->
textureState
[
textureNo
][
D3DTSS_TEXCOORDINDEX
];
TRACE
(
"Setting up texture %u, cordindx %u, data %p
\n
"
,
textureNo
,
coordIdx
,
sd
->
u
.
s
.
texCoords
[
coordIdx
].
lpData
);
if
(
!
GL_SUPPORT
(
ARB_MULTITEXTURE
)
&&
textureNo
>
0
)
{
FIXME
(
"Program using multiple concurrent textures which this opengl implementation doesn't support
\n
"
);
glDisableClientState
(
GL_TEXTURE_COORD_ARRAY
);
GLMULTITEXCOORD4F
(
textureNo
,
0
,
0
,
0
,
1
);
continue
;
}
if
(
coordIdx
>=
MAX_TEXTURES
)
{
VTRACE
((
"tex: %d - Skip tex coords, as being system generated
\n
"
,
textureNo
));
glDisableClientState
(
GL_TEXTURE_COORD_ARRAY
);
GL
MULTITEXCOORD4F
(
textureNo
,
0
,
0
,
0
,
1
);
GL
_EXTCALL
(
glMultiTexCoord4fARB
(
textureNo
,
0
,
0
,
0
,
1
)
);
}
else
if
(
sd
->
u
.
s
.
texCoords
[
coordIdx
].
lpData
==
NULL
)
{
VTRACE
((
"Bound texture but no texture coordinates supplied, so skipping
\n
"
));
glDisableClientState
(
GL_TEXTURE_COORD_ARRAY
);
GL
MULTITEXCOORD4F
(
textureNo
,
0
,
0
,
0
,
1
);
GL
_EXTCALL
(
glMultiTexCoord4fARB
(
textureNo
,
0
,
0
,
0
,
1
)
);
}
else
{
...
...
@@ -1217,7 +1217,7 @@ static void loadVertexData(IWineD3DDevice *iface, WineDirect3DVertexStridedData
}
else
{
glDisableClientState
(
GL_TEXTURE_COORD_ARRAY
);
GL
MULTITEXCOORD4F
(
textureNo
,
0
,
0
,
0
,
1
);
GL
_EXTCALL
(
glMultiTexCoord4fARB
(
textureNo
,
0
,
0
,
0
,
1
)
);
}
}
}
...
...
@@ -1444,7 +1444,7 @@ static void drawStridedSlow(IWineD3DDevice *iface, WineDirect3DVertexStridedData
case
D3DTTFF_COUNT1
:
VTRACE
((
"tex:%d, s=%f
\n
"
,
textureNo
,
s
));
if
(
GL_SUPPORT
(
ARB_MULTITEXTURE
))
{
GL
MULTITEXCOORD1F
(
textureNo
,
s
);
GL
_EXTCALL
(
glMultiTexCoord1fARB
(
textureNo
,
s
)
);
}
else
{
glTexCoord1f
(
s
);
}
...
...
@@ -1452,7 +1452,7 @@ static void drawStridedSlow(IWineD3DDevice *iface, WineDirect3DVertexStridedData
case
D3DTTFF_COUNT2
:
VTRACE
((
"tex:%d, s=%f, t=%f
\n
"
,
textureNo
,
s
,
t
));
if
(
GL_SUPPORT
(
ARB_MULTITEXTURE
))
{
GL
MULTITEXCOORD2F
(
textureNo
,
s
,
t
);
GL
_EXTCALL
(
glMultiTexCoord2fARB
(
textureNo
,
s
,
t
)
);
}
else
{
glTexCoord2f
(
s
,
t
);
}
...
...
@@ -1460,7 +1460,7 @@ static void drawStridedSlow(IWineD3DDevice *iface, WineDirect3DVertexStridedData
case
D3DTTFF_COUNT3
:
VTRACE
((
"tex:%d, s=%f, t=%f, r=%f
\n
"
,
textureNo
,
s
,
t
,
r
));
if
(
GL_SUPPORT
(
ARB_MULTITEXTURE
))
{
GL
MULTITEXCOORD3F
(
textureNo
,
s
,
t
,
r
);
GL
_EXTCALL
(
glMultiTexCoord3fARB
(
textureNo
,
s
,
t
,
r
)
);
}
else
{
glTexCoord3f
(
s
,
t
,
r
);
}
...
...
@@ -1468,7 +1468,7 @@ static void drawStridedSlow(IWineD3DDevice *iface, WineDirect3DVertexStridedData
case
D3DTTFF_COUNT4
:
VTRACE
((
"tex:%d, s=%f, t=%f, r=%f, q=%f
\n
"
,
textureNo
,
s
,
t
,
r
,
q
));
if
(
GL_SUPPORT
(
ARB_MULTITEXTURE
))
{
GL
MULTITEXCOORD4F
(
textureNo
,
s
,
t
,
r
,
q
);
GL
_EXTCALL
(
glMultiTexCoord4fARB
(
textureNo
,
s
,
t
,
r
,
q
)
);
}
else
{
glTexCoord4f
(
s
,
t
,
r
,
q
);
}
...
...
@@ -1968,7 +1968,8 @@ void inline drawPrimitiveUploadTextures(IWineD3DDeviceImpl* This) {
for
(
i
=
0
;
i
<
GL_LIMITS
(
textures
);
++
i
)
{
/* Bind the texture to the stage here */
if
(
GL_SUPPORT
(
ARB_MULTITEXTURE
))
{
GLACTIVETEXTURE
(
i
);
GL_EXTCALL
(
glActiveTextureARB
(
GL_TEXTURE0_ARB
+
i
));
checkGLcall
(
"glActiveTextureARB"
);
}
else
if
(
0
<
i
)
{
/* This isn't so much a warn as a message to the user about lack of hardware support */
WARN
(
"Program using multiple concurrent textures which this opengl implementation doesn't support
\n
"
);
...
...
dlls/wined3d/stateblock.c
View file @
54e5f9c4
...
...
@@ -815,7 +815,8 @@ HRESULT WINAPI IWineD3DStateBlockImpl_InitStartupStateBlock(IWineD3DStateBlock*
/* Make appropriate texture active */
if
(
GL_SUPPORT
(
ARB_MULTITEXTURE
))
{
GLACTIVETEXTURE
(
i
);
GL_EXTCALL
(
glActiveTextureARB
(
GL_TEXTURE0_ARB
+
i
));
checkGLcall
(
"glActiveTextureARB"
);
}
else
if
(
i
>
0
)
{
FIXME
(
"Program using multiple concurrent textures which this opengl implementation doesn't support
\n
"
);
}
...
...
dlls/wined3d/surface.c
View file @
54e5f9c4
...
...
@@ -2100,8 +2100,13 @@ HRESULT WINAPI IWineD3DSurfaceImpl_BltOverride(IWineD3DSurfaceImpl *This, RECT *
/* Unbind the old texture */
glBindTexture
(
GL_TEXTURE_2D
,
0
);
if
(
GL_SUPPORT
(
ARB_MULTITEXTURE
))
{
/* We use texture unit 0 for blts */
GLACTIVETEXTURE
(
0
);
GL_EXTCALL
(
glActiveTextureARB
(
GL_TEXTURE0_ARB
));
checkGLcall
(
"glActiveTextureARB"
);
}
else
{
WARN
(
"Multi-texturing is unsupported in the local OpenGL implementation
\n
"
);
}
/* Disable some fancy graphics effects */
glDisable
(
GL_LIGHTING
);
...
...
dlls/wined3d/wined3d_private.h
View file @
54e5f9c4
...
...
@@ -194,39 +194,8 @@ extern int num_lock;
(vec)[1] = D3DCOLOR_G(dw); \
(vec)[2] = D3DCOLOR_B(dw); \
(vec)[3] = D3DCOLOR_A(dw);
/* Note: The following is purely to keep the source code as clear from #ifdefs as possible */
#if defined(GL_VERSION_1_3)
#define GLACTIVETEXTURE(textureNo) \
glActiveTexture(GL_TEXTURE0 + textureNo); \
checkGLcall("glActiveTexture");
#define GLCLIENTACTIVETEXTURE(textureNo) \
glClientActiveTexture(GL_TEXTURE0 + textureNo);
#define GLMULTITEXCOORD1F(a,b) \
glMultiTexCoord1f(GL_TEXTURE0 + a, b);
#define GLMULTITEXCOORD2F(a,b,c) \
glMultiTexCoord2f(GL_TEXTURE0 + a, b, c);
#define GLMULTITEXCOORD3F(a,b,c,d) \
glMultiTexCoord3f(GL_TEXTURE0 + a, b, c, d);
#define GLMULTITEXCOORD4F(a,b,c,d,e) \
glMultiTexCoord4f(GL_TEXTURE0 + a, b, c, d, e);
#define GLTEXTURECUBEMAP GL_TEXTURE_CUBE_MAP
#else
#define GLACTIVETEXTURE(textureNo) \
glActiveTextureARB(GL_TEXTURE0_ARB + textureNo); \
checkGLcall("glActiveTextureARB");
#define GLCLIENTACTIVETEXTURE(textureNo) \
glClientActiveTextureARB(GL_TEXTURE0_ARB + textureNo);
#define GLMULTITEXCOORD1F(a,b) \
glMultiTexCoord1fARB(GL_TEXTURE0_ARB + a, b);
#define GLMULTITEXCOORD2F(a,b,c) \
glMultiTexCoord2fARB(GL_TEXTURE0_ARB + a, b, c);
#define GLMULTITEXCOORD3F(a,b,c,d) \
glMultiTexCoord3fARB(GL_TEXTURE0_ARB + a, b, c, d);
#define GLMULTITEXCOORD4F(a,b,c,d,e) \
glMultiTexCoord4fARB(GL_TEXTURE0_ARB + a, b, c, d, e);
#define GLTEXTURECUBEMAP GL_TEXTURE_CUBE_MAP_ARB
#endif
/* DirectX Device Limits */
/* --------------------- */
...
...
include/wine/wined3d_gl.h
View file @
54e5f9c4
...
...
@@ -131,6 +131,51 @@
#endif
typedef
void
(
APIENTRY
*
PGLFNBLENDCOLORPROC
)
(
GLclampf
red
,
GLclampf
green
,
GLclampf
blue
,
GLclampf
alpha
);
typedef
void
(
APIENTRY
*
PGLFNBLENDEQUATIONPROC
)
(
GLenum
mode
);
/* GL_ARB_multitexture */
#ifndef GL_ARB_multitexture
#define GL_ARB_multitexture 1
#define GL_TEXTURE0_ARB 0x84C0
#define GL_TEXTURE1_ARB 0x84C1
#define GL_TEXTURE2_ARB 0x84C2
#define GL_TEXTURE3_ARB 0x84C3
#define GL_TEXTURE4_ARB 0x84C4
#define GL_TEXTURE5_ARB 0x84C5
#define GL_TEXTURE6_ARB 0x84C6
#define GL_TEXTURE7_ARB 0x84C7
#define GL_TEXTURE8_ARB 0x84C8
#define GL_TEXTURE9_ARB 0x84C9
#define GL_TEXTURE10_ARB 0x84CA
#define GL_TEXTURE11_ARB 0x84CB
#define GL_TEXTURE12_ARB 0x84CC
#define GL_TEXTURE13_ARB 0x84CD
#define GL_TEXTURE14_ARB 0x84CE
#define GL_TEXTURE15_ARB 0x84CF
#define GL_TEXTURE16_ARB 0x84D0
#define GL_TEXTURE17_ARB 0x84D1
#define GL_TEXTURE18_ARB 0x84D2
#define GL_TEXTURE19_ARB 0x84D3
#define GL_TEXTURE20_ARB 0x84D4
#define GL_TEXTURE21_ARB 0x84D5
#define GL_TEXTURE22_ARB 0x84D6
#define GL_TEXTURE23_ARB 0x84D7
#define GL_TEXTURE24_ARB 0x84D8
#define GL_TEXTURE25_ARB 0x84D9
#define GL_TEXTURE26_ARB 0x84DA
#define GL_TEXTURE27_ARB 0x84DB
#define GL_TEXTURE28_ARB 0x84DC
#define GL_TEXTURE29_ARB 0x84DD
#define GL_TEXTURE30_ARB 0x84DE
#define GL_TEXTURE31_ARB 0x84DF
#define GL_ACTIVE_TEXTURE_ARB 0x84E0
#define GL_CLIENT_ACTIVE_TEXTURE_ARB 0x84E1
#define GL_MAX_TEXTURE_UNITS_ARB 0x84E2
#endif
typedef
void
(
APIENTRY
*
WINED3D_PFNGLACTIVETEXTUREARBPROC
)
(
GLenum
texture
);
typedef
void
(
APIENTRY
*
WINED3D_PFNGLCLIENTACTIVETEXTUREARBPROC
)
(
GLenum
texture
);
typedef
void
(
APIENTRY
*
WINED3D_PFNGLMULTITEXCOORD1FARBPROC
)
(
GLenum
target
,
GLfloat
s
);
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_point_parameters */
#ifndef GL_ARB_point_parameters
#define GL_ARB_point_parameters 1
...
...
@@ -1346,6 +1391,13 @@ typedef enum _GL_SupportedExt {
/* GL_ARB_imaging */
\
USE_GL_FUNC(PGLFNBLENDCOLORPROC, glBlendColor); \
USE_GL_FUNC(PGLFNBLENDEQUATIONPROC, glBlendEquation); \
/* GL_ARB_multitexture */
\
USE_GL_FUNC(WINED3D_PFNGLACTIVETEXTUREARBPROC, glActiveTextureARB); \
USE_GL_FUNC(WINED3D_PFNGLCLIENTACTIVETEXTUREARBPROC, glClientActiveTextureARB); \
USE_GL_FUNC(WINED3D_PFNGLMULTITEXCOORD1FARBPROC, glMultiTexCoord1fARB); \
USE_GL_FUNC(WINED3D_PFNGLMULTITEXCOORD2FARBPROC, glMultiTexCoord2fARB); \
USE_GL_FUNC(WINED3D_PFNGLMULTITEXCOORD3FARBPROC, glMultiTexCoord3fARB); \
USE_GL_FUNC(WINED3D_PFNGLMULTITEXCOORD4FARBPROC, glMultiTexCoord4fARB); \
/* GL_ARB_point_parameters */
\
USE_GL_FUNC(PGLFNGLPOINTPARAMETERFARBPROC, glPointParameterfARB); \
USE_GL_FUNC(PGLFNGLPOINTPARAMETERFVARBPROC, glPointParameterfvARB); \
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment