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)
HRESULT
gltex_upload_texture
(
IDirectDrawSurfaceImpl
*
surf_ptr
,
IDirect3DDeviceImpl
*
d3ddev
,
DWORD
stage
)
{
IDirect3DTextureGLImpl
*
gl_surf_ptr
=
(
IDirect3DTextureGLImpl
*
)
surf_ptr
->
tex_private
;
IDirect3DDeviceGLImpl
*
gl_d3ddev
=
(
IDirect3DDeviceGLImpl
*
)
d3ddev
;
BOOLEAN
changed
=
FALSE
;
GLenum
unit
=
GL_TEXTURE0_WINE
+
stage
;
if
(
surf_ptr
->
mipmap_level
!=
0
)
{
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
}
}
}
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
);
changed
=
TRUE
;
}
...
...
@@ -196,6 +202,10 @@ gltex_upload_texture(IDirectDrawSurfaceImpl *surf_ptr, IDirect3DDeviceImpl *d3dd
if
((
gl_surf_ptr
->
tex_parameters
==
NULL
)
||
(
gl_surf_ptr
->
tex_parameters
[
D3DTSS_MAGFILTER
-
D3DTSS_ADDRESSU
]
!=
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
,
convert_mag_filter_to_GL
(
d3ddev
->
state_block
.
texture_stage_state
[
stage
][
D3DTSS_MAGFILTER
-
1
]));
changed
=
TRUE
;
...
...
@@ -205,6 +215,10 @@ gltex_upload_texture(IDirectDrawSurfaceImpl *surf_ptr, IDirect3DDeviceImpl *d3dd
d3ddev
->
state_block
.
texture_stage_state
[
stage
][
D3DTSS_MINFILTER
-
1
])
||
(
gl_surf_ptr
->
tex_parameters
[
D3DTSS_MIPFILTER
-
D3DTSS_ADDRESSU
]
!=
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
,
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
]));
...
...
@@ -213,6 +227,10 @@ gltex_upload_texture(IDirectDrawSurfaceImpl *surf_ptr, IDirect3DDeviceImpl *d3dd
if
((
gl_surf_ptr
->
tex_parameters
==
NULL
)
||
(
gl_surf_ptr
->
tex_parameters
[
D3DTSS_ADDRESSU
-
D3DTSS_ADDRESSU
]
!=
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
,
convert_tex_address_to_GL
(
d3ddev
->
state_block
.
texture_stage_state
[
stage
][
D3DTSS_ADDRESSU
-
1
]));
changed
=
TRUE
;
...
...
@@ -220,6 +238,10 @@ gltex_upload_texture(IDirectDrawSurfaceImpl *surf_ptr, IDirect3DDeviceImpl *d3dd
if
((
gl_surf_ptr
->
tex_parameters
==
NULL
)
||
(
gl_surf_ptr
->
tex_parameters
[
D3DTSS_ADDRESSV
-
D3DTSS_ADDRESSU
]
!=
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
,
convert_tex_address_to_GL
(
d3ddev
->
state_block
.
texture_stage_state
[
stage
][
D3DTSS_ADDRESSV
-
1
]));
changed
=
TRUE
;
...
...
@@ -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
[
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
;
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
);
changed
=
TRUE
;
}
...
...
@@ -265,6 +291,11 @@ gltex_upload_texture(IDirectDrawSurfaceImpl *surf_ptr, IDirect3DDeviceImpl *d3dd
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
),
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
));
...
...
dlls/ddraw/gl_private.h
View file @
4d8d0f03
...
...
@@ -57,6 +57,15 @@
#define GL_MIRRORED_REPEAT_WINE 0x8370
#define GL_TEXTURE_FILTER_CONTROL_WINE 0x8500
#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
...
...
dlls/ddraw/main.c
View file @
4d8d0f03
...
...
@@ -83,7 +83,7 @@ static BOOL DDRAW_bind_to_opengl( void )
{
char
*
glname
=
SONAME_LIBGL
;
BOOL
ret_value
;
gl_handle
=
wine_dlopen
(
glname
,
RTLD_NOW
,
NULL
,
0
);
if
(
!
gl_handle
)
{
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
D3DVALUE
prev_clear_Z
;
BOOLEAN
depth_mask
,
depth_test
,
alpha_test
,
stencil_test
,
cull_face
,
lighting
,
blending
,
fogging
;
GLenum
current_tex_env
;
GLenum
current_active_tex_unit
;
}
IDirect3DDeviceGLImpl
;
/* This is for the OpenGL additions... */
...
...
@@ -162,7 +163,12 @@ typedef struct {
typedef
struct
{
/* Mirrored Repeat */
BOOLEAN
mirrored_repeat
;
/* Mipmap lod-bias */
BOOLEAN
mipmap_lodbias
;
/* Multi-texturing */
GLint
max_texture_units
;
void
(
*
glActiveTexture
)(
GLenum
texture
);
void
(
*
glMultiTexCoord2fv
)(
GLenum
target
,
const
GLfloat
*
v
);
}
GL_EXTENSIONS_LIST
;
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