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
4e4fc936
Commit
4e4fc936
authored
Feb 14, 2006
by
Roderick Colenbrander
Committed by
Alexandre Julliard
Feb 14, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d8: Move d3d8 surface over to wined3d (based on the work of Oliver Stieber).
parent
bc2b9e3f
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
114 additions
and
39 deletions
+114
-39
cubetexture.c
dlls/d3d8/cubetexture.c
+9
-9
d3d8_private.h
dlls/d3d8/d3d8_private.h
+94
-19
device.c
dlls/d3d8/device.c
+0
-0
resource.c
dlls/d3d8/resource.c
+3
-3
surface.c
dlls/d3d8/surface.c
+0
-0
texture.c
dlls/d3d8/texture.c
+8
-8
No files found.
dlls/d3d8/cubetexture.c
View file @
4e4fc936
...
...
@@ -143,27 +143,27 @@ void WINAPI IDirect3DCubeTexture8Impl_PreLoad(LPDIRECT3DCUBETEXTURE8
ENTER_GL
();
for
(
i
=
0
;
i
<
This
->
levels
;
i
++
)
{
if
(
i
==
0
&&
This
->
surfaces
[
0
][
0
]
->
textureName
!=
0
&&
This
->
Dirty
==
FALSE
)
{
if
(
i
==
0
&&
D3D8_SURFACE
(
This
->
surfaces
[
0
][
0
])
->
textureName
!=
0
&&
This
->
Dirty
==
FALSE
)
{
glEnable
(
GL_TEXTURE_CUBE_MAP_ARB
);
#if defined(GL_VERSION_1_3)
glBindTexture
(
GL_TEXTURE_CUBE_MAP
,
This
->
surfaces
[
0
][
0
]
->
textureName
);
glBindTexture
(
GL_TEXTURE_CUBE_MAP
,
D3D8_SURFACE
(
This
->
surfaces
[
0
][
0
])
->
textureName
);
#else
glBindTexture
(
GL_TEXTURE_CUBE_MAP_ARB
,
This
->
surfaces
[
0
][
0
]
->
textureName
);
glBindTexture
(
GL_TEXTURE_CUBE_MAP_ARB
,
D3D8_SURFACE
(
This
->
surfaces
[
0
][
0
])
->
textureName
);
#endif
checkGLcall
(
"glBindTexture"
);
TRACE
(
"Texture %p (level %d) given name %d
\n
"
,
This
->
surfaces
[
0
][
0
],
i
,
This
->
surfaces
[
0
][
0
]
->
textureName
);
TRACE
(
"Texture %p (level %d) given name %d
\n
"
,
This
->
surfaces
[
0
][
0
],
i
,
D3D8_SURFACE
(
This
->
surfaces
[
0
][
0
])
->
textureName
);
/* No need to walk through all mip-map levels, since already all assigned */
i
=
This
->
levels
;
}
else
{
if
(
i
==
0
)
{
if
(
This
->
surfaces
[
0
][
0
]
->
textureName
==
0
)
{
glGenTextures
(
1
,
&
This
->
surfaces
[
0
][
0
]
->
textureName
);
if
(
D3D8_SURFACE
(
This
->
surfaces
[
0
][
0
])
->
textureName
==
0
)
{
glGenTextures
(
1
,
&
(
D3D8_SURFACE
(
This
->
surfaces
[
0
][
0
]))
->
textureName
);
checkGLcall
(
"glGenTextures"
);
TRACE
(
"Texture %p (level %d) given name %d
\n
"
,
This
->
surfaces
[
0
][
i
],
i
,
This
->
surfaces
[
0
][
0
]
->
textureName
);
TRACE
(
"Texture %p (level %d) given name %d
\n
"
,
This
->
surfaces
[
0
][
i
],
i
,
D3D8_SURFACE
(
This
->
surfaces
[
0
][
0
])
->
textureName
);
}
#if defined(GL_VERSION_1_3)
glBindTexture
(
GL_TEXTURE_CUBE_MAP
,
This
->
surfaces
[
0
][
0
]
->
textureName
);
glBindTexture
(
GL_TEXTURE_CUBE_MAP
,
D3D8_SURFACE
(
This
->
surfaces
[
0
][
0
])
->
textureName
);
#else
glBindTexture
(
GL_TEXTURE_CUBE_MAP_ARB
,
This
->
surfaces
[
0
][
0
]
->
textureName
);
#endif
...
...
@@ -275,7 +275,7 @@ HRESULT WINAPI IDirect3DCubeTexture8Impl_AddDirtyRect(LPDIRECT3DCUBETEXT
IDirect3DCubeTexture8Impl
*
This
=
(
IDirect3DCubeTexture8Impl
*
)
iface
;
This
->
Dirty
=
TRUE
;
TRACE
(
"(%p) : dirtyfication of faceType(%d) Level (0)
\n
"
,
This
,
FaceType
);
return
I
Direct3DSurface8Impl_AddDirtyRect
((
LPDIRECT3DSURFACE8
)
This
->
surfaces
[
FaceType
][
0
]
,
pDirtyRect
);
return
I
WineD3DSurface_AddDirtyRect
(
(
IWineD3DSurface
*
)(
This
->
surfaces
[
FaceType
][
0
])
->
wineD3DSurface
,
pDirtyRect
);
}
...
...
dlls/d3d8/d3d8_private.h
View file @
4e4fc936
...
...
@@ -64,8 +64,13 @@ extern int num_lock;
#include <stdarg.h>
#define NONAMELESSUNION
#define NONAMELESSSTRUCT
#define COBJMACROS
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
#include "wine/debug.h"
#include "d3d8.h"
#include "wine/wined3d_interface.h"
...
...
@@ -674,6 +679,92 @@ extern ULONG WINAPI IDirect3DSwapChain8Impl_Release(LPDIRECT3DSWAPCHAIN8 iface
extern
HRESULT
WINAPI
IDirect3DSwapChain8Impl_Present
(
LPDIRECT3DSWAPCHAIN8
iface
,
CONST
RECT
*
pSourceRect
,
CONST
RECT
*
pDestRect
,
HWND
hDestWindowOverride
,
CONST
RGNDATA
*
pDirtyRegion
);
extern
HRESULT
WINAPI
IDirect3DSwapChain8Impl_GetBackBuffer
(
LPDIRECT3DSWAPCHAIN8
iface
,
UINT
BackBuffer
,
D3DBACKBUFFER_TYPE
Type
,
IDirect3DSurface8
**
ppBackBuffer
);
/* Below follow the definitions of some WineD3D structures which are needed during the D3D8->WineD3D transition. */
typedef
struct
IWineD3DSurfaceImpl
IWineD3DSurfaceImpl
;
typedef
struct
PrivateData
{
struct
PrivateData
*
next
;
GUID
tag
;
DWORD
flags
;
/* DDSPD_* */
DWORD
uniqueness_value
;
union
{
LPVOID
data
;
LPUNKNOWN
object
;
}
ptr
;
DWORD
size
;
}
PrivateData
;
typedef
struct
IWineD3DResourceClass
{
/* IUnknown fields */
LONG
ref
;
/* Note: Ref counting not required */
/* WineD3DResource Information */
IUnknown
*
parent
;
D3DRESOURCETYPE
resourceType
;
void
*
wineD3DDevice
;
D3DPOOL
pool
;
UINT
size
;
DWORD
usage
;
WINED3DFORMAT
format
;
BYTE
*
allocatedMemory
;
PrivateData
*
privateData
;
}
IWineD3DResourceClass
;
typedef
struct
_WINED3DSURFACET_DESC
{
D3DMULTISAMPLE_TYPE
MultiSampleType
;
DWORD
MultiSampleQuality
;
UINT
Width
;
UINT
Height
;
}
WINED3DSURFACET_DESC
;
struct
IWineD3DSurfaceImpl
{
/* IUnknown & IWineD3DResource Information */
const
IWineD3DSurfaceVtbl
*
lpVtbl
;
IWineD3DResourceClass
resource
;
/* IWineD3DSurface fields */
IUnknown
*
container
;
WINED3DSURFACET_DESC
currentDesc
;
UINT
textureName
;
UINT
bytesPerPixel
;
/* TODO: move this off into a management class(maybe!) */
BOOL
nonpow2
;
UINT
pow2Width
;
UINT
pow2Height
;
UINT
pow2Size
;
#if 0
/* precalculated x and y scalings for texture coords */
float pow2scalingFactorX; /* = (Width / pow2Width ) */
float pow2scalingFactorY; /* = (Height / pow2Height) */
#endif
BOOL
lockable
;
BOOL
discard
;
BOOL
locked
;
BOOL
activeLock
;
RECT
lockedRect
;
RECT
dirtyRect
;
BOOL
Dirty
;
BOOL
inTexture
;
BOOL
inPBuffer
;
glDescriptor
glDescription
;
};
/* ----------------- */
/* IDirect3DSurface8 */
...
...
@@ -691,28 +782,12 @@ struct IDirect3DSurface8Impl
{
/* IUnknown fields */
const
IDirect3DSurface8Vtbl
*
lpVtbl
;
LONG
ref
;
LONG
ref
;
/* IDirect3DSurface8 fields */
IDirect3DDevice8Impl
*
Device
;
D3DRESOURCETYPE
ResourceType
;
IUnknown
*
Container
;
D3DSURFACE_DESC
myDesc
;
BYTE
*
allocatedMemory
;
UINT
textureName
;
UINT
bytesPerPixel
;
BOOL
lockable
;
BOOL
locked
;
RECT
lockedRect
;
RECT
dirtyRect
;
BOOL
Dirty
;
BOOL
inTexture
;
BOOL
inPBuffer
;
IWineD3DSurface
*
wineD3DSurface
;
IWineD3DSurface
*
wineD3DSurface
;
};
#define D3D8_SURFACE(a) ((IWineD3DSurfaceImpl*)(a->wineD3DSurface))
/* IUnknown: */
extern
HRESULT
WINAPI
IDirect3DSurface8Impl_QueryInterface
(
LPDIRECT3DSURFACE8
iface
,
REFIID
refiid
,
LPVOID
*
obj
);
...
...
dlls/d3d8/device.c
View file @
4e4fc936
This diff is collapsed.
Click to expand it.
dlls/d3d8/resource.c
View file @
4e4fc936
...
...
@@ -113,15 +113,15 @@ D3DPOOL WINAPI IDirect3DResource8Impl_GetPool(LPDIRECT3DRESOURCE8 iface) {
switch
(
This
->
ResourceType
)
{
case
D3DRTYPE_SURFACE
:
return
((
IDirect3DSurface8Impl
*
)
This
)
->
myDesc
.
P
ool
;
return
D3D8_SURFACE
(((
IDirect3DSurface8Impl
*
)
This
))
->
resource
.
p
ool
;
case
D3DRTYPE_TEXTURE
:
return
((
IDirect3DTexture8Impl
*
)
This
)
->
surfaces
[
0
]
->
myDesc
.
P
ool
;
return
D3D8_SURFACE
(((
IDirect3DTexture8Impl
*
)
This
)
->
surfaces
[
0
])
->
resource
.
p
ool
;
case
D3DRTYPE_VOLUME
:
return
((
IDirect3DVolume8Impl
*
)
This
)
->
myDesc
.
Pool
;
case
D3DRTYPE_VOLUMETEXTURE
:
return
((
IDirect3DVolumeTexture8Impl
*
)
This
)
->
volumes
[
0
]
->
myDesc
.
Pool
;
case
D3DRTYPE_CUBETEXTURE
:
return
((
IDirect3DCubeTexture8Impl
*
)
This
)
->
surfaces
[
0
][
0
]
->
myDesc
.
P
ool
;
return
D3D8_SURFACE
(((
IDirect3DCubeTexture8Impl
*
)
This
)
->
surfaces
[
0
][
0
])
->
resource
.
p
ool
;
case
D3DRTYPE_VERTEXBUFFER
:
return
((
IDirect3DVertexBuffer8Impl
*
)
This
)
->
currentDesc
.
Pool
;
case
D3DRTYPE_INDEXBUFFER
:
...
...
dlls/d3d8/surface.c
View file @
4e4fc936
This diff is collapsed.
Click to expand it.
dlls/d3d8/texture.c
View file @
4e4fc936
...
...
@@ -120,22 +120,22 @@ void WINAPI IDirect3DTexture8Impl_PreLoad(LPDIRECT3DTEXTURE8 iface) {
ENTER_GL
();
for
(
i
=
0
;
i
<
This
->
levels
;
i
++
)
{
if
(
i
==
0
&&
This
->
surfaces
[
i
]
->
textureName
!=
0
&&
This
->
Dirty
==
FALSE
)
{
glBindTexture
(
GL_TEXTURE_2D
,
This
->
surfaces
[
i
]
->
textureName
);
if
(
i
==
0
&&
D3D8_SURFACE
(
This
->
surfaces
[
i
])
->
textureName
!=
0
&&
This
->
Dirty
==
FALSE
)
{
glBindTexture
(
GL_TEXTURE_2D
,
D3D8_SURFACE
(
This
->
surfaces
[
i
])
->
textureName
);
checkGLcall
(
"glBindTexture"
);
TRACE
(
"Texture %p (level %d) given name %d
\n
"
,
This
->
surfaces
[
i
],
i
,
This
->
surfaces
[
i
]
->
textureName
);
TRACE
(
"Texture %p (level %d) given name %d
\n
"
,
This
->
surfaces
[
i
],
i
,
D3D8_SURFACE
(
This
->
surfaces
[
i
])
->
textureName
);
/* No need to walk through all mip-map levels, since already all assigned */
i
=
This
->
levels
;
}
else
{
if
(
i
==
0
)
{
if
(
This
->
surfaces
[
i
]
->
textureName
==
0
)
{
glGenTextures
(
1
,
&
This
->
surfaces
[
i
]
->
textureName
);
if
(
D3D8_SURFACE
(
This
->
surfaces
[
i
])
->
textureName
==
0
)
{
glGenTextures
(
1
,
&
(
D3D8_SURFACE
(
This
->
surfaces
[
i
]))
->
textureName
);
checkGLcall
(
"glGenTextures"
);
TRACE
(
"Texture %p (level %d) given name %d
\n
"
,
This
->
surfaces
[
i
],
i
,
This
->
surfaces
[
i
]
->
textureName
);
TRACE
(
"Texture %p (level %d) given name %d
\n
"
,
This
->
surfaces
[
i
],
i
,
D3D8_SURFACE
(
This
->
surfaces
[
i
])
->
textureName
);
}
glBindTexture
(
GL_TEXTURE_2D
,
This
->
surfaces
[
i
]
->
textureName
);
glBindTexture
(
GL_TEXTURE_2D
,
D3D8_SURFACE
(
This
->
surfaces
[
i
])
->
textureName
);
checkGLcall
(
"glBindTexture"
);
}
IDirect3DSurface8Impl_LoadTexture
((
LPDIRECT3DSURFACE8
)
This
->
surfaces
[
i
],
GL_TEXTURE_2D
,
i
);
...
...
@@ -231,7 +231,7 @@ HRESULT WINAPI IDirect3DTexture8Impl_AddDirtyRect(LPDIRECT3DTEXTURE8 ifa
IDirect3DTexture8Impl
*
This
=
(
IDirect3DTexture8Impl
*
)
iface
;
This
->
Dirty
=
TRUE
;
TRACE
(
"(%p) : dirtyfication of surface Level (0)
\n
"
,
This
);
return
I
Direct3DSurface8Impl_AddDirtyRect
((
LPDIRECT3DSURFACE8
)
This
->
surfaces
[
0
]
,
pDirtyRect
);
return
I
WineD3DSurface_AddDirtyRect
(
(
IWineD3DSurface
*
)(
This
->
surfaces
[
0
])
->
wineD3DSurface
,
pDirtyRect
);
}
...
...
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