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
4d8d0f03
Commit
4d8d0f03
authored
Aug 18, 2003
by
Lionel Ulmer
Committed by
Alexandre Julliard
Aug 18, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added support for multi-texturing.
parent
228f22e9
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
47 additions
and
1 deletion
+47
-1
mesa.c
dlls/ddraw/d3ddevice/mesa.c
+0
-0
d3dtexture.c
dlls/ddraw/d3dtexture.c
+31
-0
gl_private.h
dlls/ddraw/gl_private.h
+9
-0
main.c
dlls/ddraw/main.c
+1
-1
mesa_private.h
dlls/ddraw/mesa_private.h
+6
-0
No files found.
dlls/ddraw/d3ddevice/mesa.c
View file @
4d8d0f03
This diff is collapsed.
Click to expand it.
dlls/ddraw/d3dtexture.c
View file @
4d8d0f03
...
@@ -162,7 +162,9 @@ convert_tex_address_to_GL(D3DTEXTUREADDRESS dwState)
...
@@ -162,7 +162,9 @@ convert_tex_address_to_GL(D3DTEXTUREADDRESS dwState)
HRESULT
HRESULT
gltex_upload_texture
(
IDirectDrawSurfaceImpl
*
surf_ptr
,
IDirect3DDeviceImpl
*
d3ddev
,
DWORD
stage
)
{
gltex_upload_texture
(
IDirectDrawSurfaceImpl
*
surf_ptr
,
IDirect3DDeviceImpl
*
d3ddev
,
DWORD
stage
)
{
IDirect3DTextureGLImpl
*
gl_surf_ptr
=
(
IDirect3DTextureGLImpl
*
)
surf_ptr
->
tex_private
;
IDirect3DTextureGLImpl
*
gl_surf_ptr
=
(
IDirect3DTextureGLImpl
*
)
surf_ptr
->
tex_private
;
IDirect3DDeviceGLImpl
*
gl_d3ddev
=
(
IDirect3DDeviceGLImpl
*
)
d3ddev
;
BOOLEAN
changed
=
FALSE
;
BOOLEAN
changed
=
FALSE
;
GLenum
unit
=
GL_TEXTURE0_WINE
+
stage
;
if
(
surf_ptr
->
mipmap_level
!=
0
)
{
if
(
surf_ptr
->
mipmap_level
!=
0
)
{
WARN
(
" application activating a sub-level of the mipmapping chain (level %d) !
\n
"
,
surf_ptr
->
mipmap_level
);
WARN
(
" application activating a sub-level of the mipmapping chain (level %d) !
\n
"
,
surf_ptr
->
mipmap_level
);
...
@@ -189,6 +191,10 @@ gltex_upload_texture(IDirectDrawSurfaceImpl *surf_ptr, IDirect3DDeviceImpl *d3dd
...
@@ -189,6 +191,10 @@ gltex_upload_texture(IDirectDrawSurfaceImpl *surf_ptr, IDirect3DDeviceImpl *d3dd
}
}
}
}
}
}
if
(
unit
!=
gl_d3ddev
->
current_active_tex_unit
)
{
GL_extensions
.
glActiveTexture
(
unit
);
gl_d3ddev
->
current_active_tex_unit
=
unit
;
}
glTexParameteri
(
GL_TEXTURE_2D
,
GL_TEXTURE_MAX_LEVEL
,
max_mip_level
);
glTexParameteri
(
GL_TEXTURE_2D
,
GL_TEXTURE_MAX_LEVEL
,
max_mip_level
);
changed
=
TRUE
;
changed
=
TRUE
;
}
}
...
@@ -196,6 +202,10 @@ gltex_upload_texture(IDirectDrawSurfaceImpl *surf_ptr, IDirect3DDeviceImpl *d3dd
...
@@ -196,6 +202,10 @@ gltex_upload_texture(IDirectDrawSurfaceImpl *surf_ptr, IDirect3DDeviceImpl *d3dd
if
((
gl_surf_ptr
->
tex_parameters
==
NULL
)
||
if
((
gl_surf_ptr
->
tex_parameters
==
NULL
)
||
(
gl_surf_ptr
->
tex_parameters
[
D3DTSS_MAGFILTER
-
D3DTSS_ADDRESSU
]
!=
(
gl_surf_ptr
->
tex_parameters
[
D3DTSS_MAGFILTER
-
D3DTSS_ADDRESSU
]
!=
d3ddev
->
state_block
.
texture_stage_state
[
stage
][
D3DTSS_MAGFILTER
-
1
]))
{
d3ddev
->
state_block
.
texture_stage_state
[
stage
][
D3DTSS_MAGFILTER
-
1
]))
{
if
(
unit
!=
gl_d3ddev
->
current_active_tex_unit
)
{
GL_extensions
.
glActiveTexture
(
unit
);
gl_d3ddev
->
current_active_tex_unit
=
unit
;
}
glTexParameteri
(
GL_TEXTURE_2D
,
GL_TEXTURE_MAG_FILTER
,
glTexParameteri
(
GL_TEXTURE_2D
,
GL_TEXTURE_MAG_FILTER
,
convert_mag_filter_to_GL
(
d3ddev
->
state_block
.
texture_stage_state
[
stage
][
D3DTSS_MAGFILTER
-
1
]));
convert_mag_filter_to_GL
(
d3ddev
->
state_block
.
texture_stage_state
[
stage
][
D3DTSS_MAGFILTER
-
1
]));
changed
=
TRUE
;
changed
=
TRUE
;
...
@@ -205,6 +215,10 @@ gltex_upload_texture(IDirectDrawSurfaceImpl *surf_ptr, IDirect3DDeviceImpl *d3dd
...
@@ -205,6 +215,10 @@ gltex_upload_texture(IDirectDrawSurfaceImpl *surf_ptr, IDirect3DDeviceImpl *d3dd
d3ddev
->
state_block
.
texture_stage_state
[
stage
][
D3DTSS_MINFILTER
-
1
])
||
d3ddev
->
state_block
.
texture_stage_state
[
stage
][
D3DTSS_MINFILTER
-
1
])
||
(
gl_surf_ptr
->
tex_parameters
[
D3DTSS_MIPFILTER
-
D3DTSS_ADDRESSU
]
!=
(
gl_surf_ptr
->
tex_parameters
[
D3DTSS_MIPFILTER
-
D3DTSS_ADDRESSU
]
!=
d3ddev
->
state_block
.
texture_stage_state
[
stage
][
D3DTSS_MIPFILTER
-
1
]))
{
d3ddev
->
state_block
.
texture_stage_state
[
stage
][
D3DTSS_MIPFILTER
-
1
]))
{
if
(
unit
!=
gl_d3ddev
->
current_active_tex_unit
)
{
GL_extensions
.
glActiveTexture
(
unit
);
gl_d3ddev
->
current_active_tex_unit
=
unit
;
}
glTexParameteri
(
GL_TEXTURE_2D
,
GL_TEXTURE_MIN_FILTER
,
glTexParameteri
(
GL_TEXTURE_2D
,
GL_TEXTURE_MIN_FILTER
,
convert_min_filter_to_GL
(
d3ddev
->
state_block
.
texture_stage_state
[
stage
][
D3DTSS_MINFILTER
-
1
],
convert_min_filter_to_GL
(
d3ddev
->
state_block
.
texture_stage_state
[
stage
][
D3DTSS_MINFILTER
-
1
],
d3ddev
->
state_block
.
texture_stage_state
[
stage
][
D3DTSS_MIPFILTER
-
1
]));
d3ddev
->
state_block
.
texture_stage_state
[
stage
][
D3DTSS_MIPFILTER
-
1
]));
...
@@ -213,6 +227,10 @@ gltex_upload_texture(IDirectDrawSurfaceImpl *surf_ptr, IDirect3DDeviceImpl *d3dd
...
@@ -213,6 +227,10 @@ gltex_upload_texture(IDirectDrawSurfaceImpl *surf_ptr, IDirect3DDeviceImpl *d3dd
if
((
gl_surf_ptr
->
tex_parameters
==
NULL
)
||
if
((
gl_surf_ptr
->
tex_parameters
==
NULL
)
||
(
gl_surf_ptr
->
tex_parameters
[
D3DTSS_ADDRESSU
-
D3DTSS_ADDRESSU
]
!=
(
gl_surf_ptr
->
tex_parameters
[
D3DTSS_ADDRESSU
-
D3DTSS_ADDRESSU
]
!=
d3ddev
->
state_block
.
texture_stage_state
[
stage
][
D3DTSS_ADDRESSU
-
1
]))
{
d3ddev
->
state_block
.
texture_stage_state
[
stage
][
D3DTSS_ADDRESSU
-
1
]))
{
if
(
unit
!=
gl_d3ddev
->
current_active_tex_unit
)
{
GL_extensions
.
glActiveTexture
(
unit
);
gl_d3ddev
->
current_active_tex_unit
=
unit
;
}
glTexParameteri
(
GL_TEXTURE_2D
,
GL_TEXTURE_WRAP_S
,
glTexParameteri
(
GL_TEXTURE_2D
,
GL_TEXTURE_WRAP_S
,
convert_tex_address_to_GL
(
d3ddev
->
state_block
.
texture_stage_state
[
stage
][
D3DTSS_ADDRESSU
-
1
]));
convert_tex_address_to_GL
(
d3ddev
->
state_block
.
texture_stage_state
[
stage
][
D3DTSS_ADDRESSU
-
1
]));
changed
=
TRUE
;
changed
=
TRUE
;
...
@@ -220,6 +238,10 @@ gltex_upload_texture(IDirectDrawSurfaceImpl *surf_ptr, IDirect3DDeviceImpl *d3dd
...
@@ -220,6 +238,10 @@ gltex_upload_texture(IDirectDrawSurfaceImpl *surf_ptr, IDirect3DDeviceImpl *d3dd
if
((
gl_surf_ptr
->
tex_parameters
==
NULL
)
||
if
((
gl_surf_ptr
->
tex_parameters
==
NULL
)
||
(
gl_surf_ptr
->
tex_parameters
[
D3DTSS_ADDRESSV
-
D3DTSS_ADDRESSU
]
!=
(
gl_surf_ptr
->
tex_parameters
[
D3DTSS_ADDRESSV
-
D3DTSS_ADDRESSU
]
!=
d3ddev
->
state_block
.
texture_stage_state
[
stage
][
D3DTSS_ADDRESSV
-
1
]))
{
d3ddev
->
state_block
.
texture_stage_state
[
stage
][
D3DTSS_ADDRESSV
-
1
]))
{
if
(
unit
!=
gl_d3ddev
->
current_active_tex_unit
)
{
GL_extensions
.
glActiveTexture
(
unit
);
gl_d3ddev
->
current_active_tex_unit
=
unit
;
}
glTexParameteri
(
GL_TEXTURE_2D
,
GL_TEXTURE_WRAP_T
,
glTexParameteri
(
GL_TEXTURE_2D
,
GL_TEXTURE_WRAP_T
,
convert_tex_address_to_GL
(
d3ddev
->
state_block
.
texture_stage_state
[
stage
][
D3DTSS_ADDRESSV
-
1
]));
convert_tex_address_to_GL
(
d3ddev
->
state_block
.
texture_stage_state
[
stage
][
D3DTSS_ADDRESSV
-
1
]));
changed
=
TRUE
;
changed
=
TRUE
;
...
@@ -233,6 +255,10 @@ gltex_upload_texture(IDirectDrawSurfaceImpl *surf_ptr, IDirect3DDeviceImpl *d3dd
...
@@ -233,6 +255,10 @@ gltex_upload_texture(IDirectDrawSurfaceImpl *surf_ptr, IDirect3DDeviceImpl *d3dd
color
[
1
]
=
((
d3ddev
->
state_block
.
texture_stage_state
[
stage
][
D3DTSS_BORDERCOLOR
-
1
]
>>
8
)
&
0xFF
)
/
255
.
0
;
color
[
1
]
=
((
d3ddev
->
state_block
.
texture_stage_state
[
stage
][
D3DTSS_BORDERCOLOR
-
1
]
>>
8
)
&
0xFF
)
/
255
.
0
;
color
[
2
]
=
((
d3ddev
->
state_block
.
texture_stage_state
[
stage
][
D3DTSS_BORDERCOLOR
-
1
]
>>
0
)
&
0xFF
)
/
255
.
0
;
color
[
2
]
=
((
d3ddev
->
state_block
.
texture_stage_state
[
stage
][
D3DTSS_BORDERCOLOR
-
1
]
>>
0
)
&
0xFF
)
/
255
.
0
;
color
[
3
]
=
((
d3ddev
->
state_block
.
texture_stage_state
[
stage
][
D3DTSS_BORDERCOLOR
-
1
]
>>
24
)
&
0xFF
)
/
255
.
0
;
color
[
3
]
=
((
d3ddev
->
state_block
.
texture_stage_state
[
stage
][
D3DTSS_BORDERCOLOR
-
1
]
>>
24
)
&
0xFF
)
/
255
.
0
;
if
(
unit
!=
gl_d3ddev
->
current_active_tex_unit
)
{
GL_extensions
.
glActiveTexture
(
unit
);
gl_d3ddev
->
current_active_tex_unit
=
unit
;
}
glTexParameterfv
(
GL_TEXTURE_2D
,
GL_TEXTURE_BORDER_COLOR
,
color
);
glTexParameterfv
(
GL_TEXTURE_2D
,
GL_TEXTURE_BORDER_COLOR
,
color
);
changed
=
TRUE
;
changed
=
TRUE
;
}
}
...
@@ -265,6 +291,11 @@ gltex_upload_texture(IDirectDrawSurfaceImpl *surf_ptr, IDirect3DDeviceImpl *d3dd
...
@@ -265,6 +291,11 @@ gltex_upload_texture(IDirectDrawSurfaceImpl *surf_ptr, IDirect3DDeviceImpl *d3dd
snoop_texture
(
surf_ptr
);
snoop_texture
(
surf_ptr
);
}
}
if
(
unit
!=
gl_d3ddev
->
current_active_tex_unit
)
{
GL_extensions
.
glActiveTexture
(
unit
);
gl_d3ddev
->
current_active_tex_unit
=
unit
;
}
if
(
upload_surface_to_tex_memory_init
(
surf_ptr
,
surf_ptr
->
mipmap_level
,
&
(
gl_surf_ptr
->
current_internal_format
),
if
(
upload_surface_to_tex_memory_init
(
surf_ptr
,
surf_ptr
->
mipmap_level
,
&
(
gl_surf_ptr
->
current_internal_format
),
gl_surf_ptr
->
initial_upload_done
==
FALSE
,
TRUE
,
0
,
0
)
==
DD_OK
)
{
gl_surf_ptr
->
initial_upload_done
==
FALSE
,
TRUE
,
0
,
0
)
==
DD_OK
)
{
upload_surface_to_tex_memory
(
NULL
,
0
,
0
,
&
(
gl_surf_ptr
->
surface_ptr
));
upload_surface_to_tex_memory
(
NULL
,
0
,
0
,
&
(
gl_surf_ptr
->
surface_ptr
));
...
...
dlls/ddraw/gl_private.h
View file @
4d8d0f03
...
@@ -57,6 +57,15 @@
...
@@ -57,6 +57,15 @@
#define GL_MIRRORED_REPEAT_WINE 0x8370
#define GL_MIRRORED_REPEAT_WINE 0x8370
#define GL_TEXTURE_FILTER_CONTROL_WINE 0x8500
#define GL_TEXTURE_FILTER_CONTROL_WINE 0x8500
#define GL_TEXTURE_LOD_BIAS_WINE 0x8501
#define GL_TEXTURE_LOD_BIAS_WINE 0x8501
#define GL_TEXTURE0_WINE 0x84C0
#define GL_TEXTURE1_WINE 0x84C1
#define GL_TEXTURE2_WINE 0x84C2
#define GL_TEXTURE3_WINE 0x84C3
#define GL_TEXTURE4_WINE 0x84C4
#define GL_TEXTURE5_WINE 0x84C5
#define GL_TEXTURE6_WINE 0x84C6
#define GL_TEXTURE7_WINE 0x84C7
#define GL_MAX_TEXTURE_UNITS_WINE 0x84E2
#ifndef GLPRIVATE_NO_REDEFINE
#ifndef GLPRIVATE_NO_REDEFINE
...
...
dlls/ddraw/main.c
View file @
4d8d0f03
...
@@ -83,7 +83,7 @@ static BOOL DDRAW_bind_to_opengl( void )
...
@@ -83,7 +83,7 @@ static BOOL DDRAW_bind_to_opengl( void )
{
{
char
*
glname
=
SONAME_LIBGL
;
char
*
glname
=
SONAME_LIBGL
;
BOOL
ret_value
;
BOOL
ret_value
;
gl_handle
=
wine_dlopen
(
glname
,
RTLD_NOW
,
NULL
,
0
);
gl_handle
=
wine_dlopen
(
glname
,
RTLD_NOW
,
NULL
,
0
);
if
(
!
gl_handle
)
{
if
(
!
gl_handle
)
{
WARN
(
"Wine cannot find the OpenGL graphics library (%s).
\n
"
,
glname
);
WARN
(
"Wine cannot find the OpenGL graphics library (%s).
\n
"
,
glname
);
...
...
dlls/ddraw/mesa_private.h
View file @
4d8d0f03
...
@@ -143,6 +143,7 @@ typedef struct IDirect3DDeviceGLImpl
...
@@ -143,6 +143,7 @@ typedef struct IDirect3DDeviceGLImpl
D3DVALUE
prev_clear_Z
;
D3DVALUE
prev_clear_Z
;
BOOLEAN
depth_mask
,
depth_test
,
alpha_test
,
stencil_test
,
cull_face
,
lighting
,
blending
,
fogging
;
BOOLEAN
depth_mask
,
depth_test
,
alpha_test
,
stencil_test
,
cull_face
,
lighting
,
blending
,
fogging
;
GLenum
current_tex_env
;
GLenum
current_tex_env
;
GLenum
current_active_tex_unit
;
}
IDirect3DDeviceGLImpl
;
}
IDirect3DDeviceGLImpl
;
/* This is for the OpenGL additions... */
/* This is for the OpenGL additions... */
...
@@ -162,7 +163,12 @@ typedef struct {
...
@@ -162,7 +163,12 @@ typedef struct {
typedef
struct
{
typedef
struct
{
/* Mirrored Repeat */
/* Mirrored Repeat */
BOOLEAN
mirrored_repeat
;
BOOLEAN
mirrored_repeat
;
/* Mipmap lod-bias */
BOOLEAN
mipmap_lodbias
;
BOOLEAN
mipmap_lodbias
;
/* Multi-texturing */
GLint
max_texture_units
;
void
(
*
glActiveTexture
)(
GLenum
texture
);
void
(
*
glMultiTexCoord2fv
)(
GLenum
target
,
const
GLfloat
*
v
);
}
GL_EXTENSIONS_LIST
;
}
GL_EXTENSIONS_LIST
;
extern
GL_EXTENSIONS_LIST
GL_extensions
;
extern
GL_EXTENSIONS_LIST
GL_extensions
;
...
...
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