Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
acdc84e6
Commit
acdc84e6
authored
Apr 11, 2005
by
Lionel Ulmer
Committed by
Alexandre Julliard
Apr 11, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Create the GL texture id at texture-binding time.
parent
01cd9fb2
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
36 additions
and
14 deletions
+36
-14
mesa.c
dlls/ddraw/d3ddevice/mesa.c
+1
-1
d3dtexture.c
dlls/ddraw/d3dtexture.c
+31
-13
mesa_private.h
dlls/ddraw/mesa_private.h
+4
-0
No files found.
dlls/ddraw/d3ddevice/mesa.c
View file @
acdc84e6
...
@@ -2257,7 +2257,7 @@ draw_primitive_handle_textures(IDirect3DDeviceImpl *This)
...
@@ -2257,7 +2257,7 @@ draw_primitive_handle_textures(IDirect3DDeviceImpl *This)
glBindTexture
(
GL_TEXTURE_2D
,
0
);
glBindTexture
(
GL_TEXTURE_2D
,
0
);
glDisable
(
GL_TEXTURE_2D
);
glDisable
(
GL_TEXTURE_2D
);
}
else
{
}
else
{
GLenum
tex_name
=
((
IDirect3DTextureGLImpl
*
)
surf_ptr
->
tex_private
)
->
tex_name
;
GLenum
tex_name
=
gltex_get_tex_name
(
surf_ptr
)
;
unit
=
GL_TEXTURE0_WINE
+
stage
;
unit
=
GL_TEXTURE0_WINE
+
stage
;
if
(
unit
!=
glThis
->
current_active_tex_unit
)
{
if
(
unit
!=
glThis
->
current_active_tex_unit
)
{
...
...
dlls/ddraw/d3dtexture.c
View file @
acdc84e6
...
@@ -417,6 +417,8 @@ gltex_bltfast(IDirectDrawSurfaceImpl *surf_ptr, DWORD dstx,
...
@@ -417,6 +417,8 @@ gltex_bltfast(IDirectDrawSurfaceImpl *surf_ptr, DWORD dstx,
ENTER_GL
();
ENTER_GL
();
glGetIntegerv
(
GL_TEXTURE_BINDING_2D
,
&
cur_tex
);
glGetIntegerv
(
GL_TEXTURE_BINDING_2D
,
&
cur_tex
);
/* This call is to create the actual texture name in GL (as we do 'late' ID creation) */
gltex_get_tex_name
(
surf_ptr
);
glBindTexture
(
GL_TEXTURE_2D
,
gl_surf_ptr
->
tex_name
);
glBindTexture
(
GL_TEXTURE_2D
,
gl_surf_ptr
->
tex_name
);
if
((
gl_surf_ptr
->
dirty_flag
==
SURFACE_MEMORY_DIRTY
)
&&
if
((
gl_surf_ptr
->
dirty_flag
==
SURFACE_MEMORY_DIRTY
)
&&
...
@@ -706,9 +708,6 @@ GL_IDirect3DTextureImpl_2_1T_Load(LPDIRECT3DTEXTURE2 iface,
...
@@ -706,9 +708,6 @@ GL_IDirect3DTextureImpl_2_1T_Load(LPDIRECT3DTEXTURE2 iface,
memcpy
(
dst_d
->
lpSurface
,
src_d
->
lpSurface
,
src_d
->
u1
.
lPitch
*
src_d
->
dwHeight
);
memcpy
(
dst_d
->
lpSurface
,
src_d
->
lpSurface
,
src_d
->
u1
.
lPitch
*
src_d
->
dwHeight
);
if
(
gl_dst_ptr
!=
NULL
)
{
if
(
gl_dst_ptr
!=
NULL
)
{
/* If the GetHandle was not done, it is an error... */
if
(
gl_dst_ptr
->
tex_name
==
0
)
ERR
(
"Unbound GL texture !!!
\n
"
);
/* Set this texture as dirty */
/* Set this texture as dirty */
gl_dst_ptr
->
dirty_flag
=
SURFACE_MEMORY_DIRTY
;
gl_dst_ptr
->
dirty_flag
=
SURFACE_MEMORY_DIRTY
;
*
(
gl_dst_ptr
->
global_dirty_flag
)
=
SURFACE_MEMORY_DIRTY
;
*
(
gl_dst_ptr
->
global_dirty_flag
)
=
SURFACE_MEMORY_DIRTY
;
...
@@ -875,6 +874,8 @@ HRESULT d3dtexture_create(IDirectDrawImpl *d3d, IDirectDrawSurfaceImpl *surf, BO
...
@@ -875,6 +874,8 @@ HRESULT d3dtexture_create(IDirectDrawImpl *d3d, IDirectDrawSurfaceImpl *surf, BO
private
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
IDirect3DTextureGLImpl
));
private
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
IDirect3DTextureGLImpl
));
if
(
private
==
NULL
)
return
DDERR_OUTOFMEMORY
;
if
(
private
==
NULL
)
return
DDERR_OUTOFMEMORY
;
surf
->
tex_private
=
private
;
private
->
final_release
=
surf
->
final_release
;
private
->
final_release
=
surf
->
final_release
;
private
->
lock_update
=
surf
->
lock_update
;
private
->
lock_update
=
surf
->
lock_update
;
private
->
unlock_update
=
surf
->
unlock_update
;
private
->
unlock_update
=
surf
->
unlock_update
;
...
@@ -885,7 +886,6 @@ HRESULT d3dtexture_create(IDirectDrawImpl *d3d, IDirectDrawSurfaceImpl *surf, BO
...
@@ -885,7 +886,6 @@ HRESULT d3dtexture_create(IDirectDrawImpl *d3d, IDirectDrawSurfaceImpl *surf, BO
surf
->
final_release
=
gltex_final_release
;
surf
->
final_release
=
gltex_final_release
;
surf
->
lock_update
=
gltex_lock_update
;
surf
->
lock_update
=
gltex_lock_update
;
surf
->
unlock_update
=
gltex_unlock_update
;
surf
->
unlock_update
=
gltex_unlock_update
;
surf
->
tex_private
=
private
;
surf
->
aux_setcolorkey_cb
=
gltex_setcolorkey_cb
;
surf
->
aux_setcolorkey_cb
=
gltex_setcolorkey_cb
;
surf
->
set_palette
=
gltex_set_palette
;
surf
->
set_palette
=
gltex_set_palette
;
...
@@ -896,24 +896,42 @@ HRESULT d3dtexture_create(IDirectDrawImpl *d3d, IDirectDrawSurfaceImpl *surf, BO
...
@@ -896,24 +896,42 @@ HRESULT d3dtexture_create(IDirectDrawImpl *d3d, IDirectDrawSurfaceImpl *surf, BO
TRACE
(
" GL texture created for surface %p (private data at %p)
\n
"
,
surf
,
private
);
TRACE
(
" GL texture created for surface %p (private data at %p)
\n
"
,
surf
,
private
);
/* Do not create the OpenGL texture id here as some game generate textures from a different thread which
cause problems.. */
private
->
tex_name
=
0
;
if
(
surf
->
mipmap_level
==
0
)
{
private
->
main
=
NULL
;
private
->
global_dirty_flag
=
&
(
private
->
__global_dirty_flag
);
}
else
{
private
->
main
=
main
;
private
->
global_dirty_flag
=
&
(((
IDirect3DTextureGLImpl
*
)
(
private
->
main
->
tex_private
))
->
__global_dirty_flag
);
}
private
->
initial_upload_done
=
FALSE
;
}
return
D3D_OK
;
}
GLuint
gltex_get_tex_name
(
IDirectDrawSurfaceImpl
*
surf
)
{
IDirect3DTextureGLImpl
*
private
=
(
IDirect3DTextureGLImpl
*
)
(
surf
->
tex_private
);
if
(
private
->
tex_name
==
0
)
{
/* The texture was not created yet... */
ENTER_GL
();
ENTER_GL
();
if
(
surf
->
mipmap_level
==
0
)
{
if
(
surf
->
mipmap_level
==
0
)
{
glGenTextures
(
1
,
&
(
private
->
tex_name
));
glGenTextures
(
1
,
&
(
private
->
tex_name
));
if
(
private
->
tex_name
==
0
)
ERR
(
"Error at creation of OpenGL texture ID !
\n
"
);
if
(
private
->
tex_name
==
0
)
ERR
(
"Error at creation of OpenGL texture ID !
\n
"
);
TRACE
(
" GL texture id is : %d.
\n
"
,
private
->
tex_name
);
TRACE
(
" GL texture id is : %d.
\n
"
,
private
->
tex_name
);
private
->
__global_dirty_flag
=
(
at_creation
==
FALSE
?
SURFACE_MEMORY_DIRTY
:
SURFACE_MEMORY
);
private
->
__global_dirty_flag
=
SURFACE_MEMORY_DIRTY
;
private
->
global_dirty_flag
=
&
(
private
->
__global_dirty_flag
);
}
else
{
}
else
{
private
->
tex_name
=
((
IDirect3DTextureGLImpl
*
)
(
main
->
tex_private
))
->
tex_name
;
private
->
tex_name
=
gltex_get_tex_name
(
private
->
main
);
TRACE
(
" GL texture id reusing id %d from surface %p (private at %p)).
\n
"
,
private
->
tex_name
,
main
,
main
->
tex_private
);
TRACE
(
" GL texture id reusing id %d from surface %p (private at %p)).
\n
"
,
private
->
tex_name
,
private
->
main
,
private
->
main
->
tex_private
);
private
->
global_dirty_flag
=
&
(((
IDirect3DTextureGLImpl
*
)
(
main
->
tex_private
))
->
__global_dirty_flag
);
}
}
LEAVE_GL
();
LEAVE_GL
();
/* And set the dirty flag accordingly */
/* And set the dirty flag accordingly */
private
->
dirty_flag
=
(
at_creation
==
FALSE
?
SURFACE_MEMORY_DIRTY
:
SURFACE_MEMORY
);
private
->
dirty_flag
=
SURFACE_MEMORY_DIRTY
;
private
->
initial_upload_done
=
FALSE
;
}
}
return
((
IDirect3DTextureGLImpl
*
)
(
surf
->
tex_private
))
->
tex_name
;
return
D3D_OK
;
}
}
dlls/ddraw/mesa_private.h
View file @
acdc84e6
...
@@ -63,6 +63,7 @@ typedef struct IDirect3DTextureGLImpl
...
@@ -63,6 +63,7 @@ typedef struct IDirect3DTextureGLImpl
{
{
GLuint
tex_name
;
GLuint
tex_name
;
BOOLEAN
loaded
;
/* For the moment, this is here.. Should be part of surface management though */
BOOLEAN
loaded
;
/* For the moment, this is here.. Should be part of surface management though */
IDirectDrawSurfaceImpl
*
main
;
/* Pointer to the 'main' surface of the mip-map set */
/* Texture upload management */
/* Texture upload management */
BOOLEAN
initial_upload_done
;
BOOLEAN
initial_upload_done
;
...
@@ -202,6 +203,9 @@ extern BOOL d3ddevice_init_at_startup(void *gl_handle);
...
@@ -202,6 +203,9 @@ extern BOOL d3ddevice_init_at_startup(void *gl_handle);
/* Used to upload the texture */
/* Used to upload the texture */
extern
HRESULT
gltex_upload_texture
(
IDirectDrawSurfaceImpl
*
This
,
IDirect3DDeviceImpl
*
d3ddev
,
DWORD
stage
)
;
extern
HRESULT
gltex_upload_texture
(
IDirectDrawSurfaceImpl
*
This
,
IDirect3DDeviceImpl
*
d3ddev
,
DWORD
stage
)
;
/* Used to get the texture name */
extern
GLuint
gltex_get_tex_name
(
IDirectDrawSurfaceImpl
*
This
)
;
/* Used to set-up our orthographic projection */
/* Used to set-up our orthographic projection */
extern
void
d3ddevice_set_ortho
(
IDirect3DDeviceImpl
*
This
)
;
extern
void
d3ddevice_set_ortho
(
IDirect3DDeviceImpl
*
This
)
;
...
...
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