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
5ec05c55
Commit
5ec05c55
authored
Sep 17, 2009
by
Henri Verbeet
Committed by
Alexandre Julliard
Sep 18, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d9: Add a separate function for index buffer initialization.
parent
c2a240e8
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
50 additions
and
35 deletions
+50
-35
d3d9_private.h
dlls/d3d9/d3d9_private.h
+3
-3
device.c
dlls/d3d9/device.c
+31
-0
indexbuffer.c
dlls/d3d9/indexbuffer.c
+16
-32
No files found.
dlls/d3d9/d3d9_private.h
View file @
5ec05c55
...
...
@@ -200,9 +200,6 @@ extern UINT WINAPI IDirect3DDevice9Impl_GetNumberOfSwapChains(IDirect3DDevice9Ex
extern
HRESULT
WINAPI
IDirect3DDevice9Impl_CreateVertexBuffer
(
IDirect3DDevice9Ex
*
iface
,
UINT
Length
,
DWORD
Usage
,
DWORD
FVF
,
D3DPOOL
Pool
,
IDirect3DVertexBuffer9
**
ppVertexBuffer
,
HANDLE
*
pSharedHandle
)
DECLSPEC_HIDDEN
;
extern
HRESULT
WINAPI
IDirect3DDevice9Impl_CreateIndexBuffer
(
IDirect3DDevice9Ex
*
iface
,
UINT
Length
,
DWORD
Usage
,
D3DFORMAT
Format
,
D3DPOOL
Pool
,
IDirect3DIndexBuffer9
**
ppIndexBuffer
,
HANDLE
*
pSharedHandle
)
DECLSPEC_HIDDEN
;
extern
HRESULT
WINAPI
IDirect3DDevice9Impl_CreateStateBlock
(
IDirect3DDevice9Ex
*
iface
,
D3DSTATEBLOCKTYPE
Type
,
IDirect3DStateBlock9
**
ppSB
)
DECLSPEC_HIDDEN
;
extern
HRESULT
WINAPI
IDirect3DDevice9Impl_BeginStateBlock
(
IDirect3DDevice9Ex
*
iface
)
DECLSPEC_HIDDEN
;
...
...
@@ -378,6 +375,9 @@ typedef struct IDirect3DIndexBuffer9Impl
WINED3DFORMAT
format
;
}
IDirect3DIndexBuffer9Impl
;
HRESULT
indexbuffer_init
(
IDirect3DIndexBuffer9Impl
*
buffer
,
IDirect3DDevice9Impl
*
device
,
UINT
size
,
DWORD
usage
,
D3DFORMAT
format
,
D3DPOOL
pool
)
DECLSPEC_HIDDEN
;
/* --------------------- */
/* IDirect3DBaseTexture9 */
/* --------------------- */
...
...
dlls/d3d9/device.c
View file @
5ec05c55
...
...
@@ -742,6 +742,37 @@ static HRESULT WINAPI IDirect3DDevice9Impl_CreateCubeTexture(IDirect3DDevice9Ex
return
D3D_OK
;
}
static
HRESULT
WINAPI
IDirect3DDevice9Impl_CreateIndexBuffer
(
IDirect3DDevice9Ex
*
iface
,
UINT
size
,
DWORD
usage
,
D3DFORMAT
format
,
D3DPOOL
pool
,
IDirect3DIndexBuffer9
**
buffer
,
HANDLE
*
shared_handle
)
{
IDirect3DDevice9Impl
*
This
=
(
IDirect3DDevice9Impl
*
)
iface
;
IDirect3DIndexBuffer9Impl
*
object
;
HRESULT
hr
;
TRACE
(
"iface %p, size %u, usage %#x, format %#x, pool %#x, buffer %p, shared_handle %p.
\n
"
,
iface
,
size
,
usage
,
format
,
pool
,
buffer
,
shared_handle
);
object
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
object
));
if
(
!
object
)
{
ERR
(
"Failed to allocate buffer memory.
\n
"
);
return
D3DERR_OUTOFVIDEOMEMORY
;
}
hr
=
indexbuffer_init
(
object
,
This
,
size
,
usage
,
format
,
pool
);
if
(
FAILED
(
hr
))
{
WARN
(
"Failed to initialize index buffer, hr %#x.
\n
"
,
hr
);
HeapFree
(
GetProcessHeap
(),
0
,
object
);
return
hr
;
}
TRACE
(
"Created index buffer %p.
\n
"
,
object
);
*
buffer
=
(
IDirect3DIndexBuffer9
*
)
object
;
return
D3D_OK
;
}
static
HRESULT
IDirect3DDevice9Impl_CreateSurface
(
LPDIRECT3DDEVICE9EX
iface
,
UINT
Width
,
UINT
Height
,
D3DFORMAT
Format
,
BOOL
Lockable
,
BOOL
Discard
,
UINT
Level
,
IDirect3DSurface9
**
ppSurface
,
UINT
Usage
,
D3DPOOL
Pool
,
D3DMULTISAMPLE_TYPE
MultiSample
,
DWORD
MultisampleQuality
)
...
...
dlls/d3d9/indexbuffer.c
View file @
5ec05c55
...
...
@@ -230,43 +230,27 @@ static const IDirect3DIndexBuffer9Vtbl Direct3DIndexBuffer9_Vtbl =
IDirect3DIndexBuffer9Impl_GetDesc
};
/* IDirect3DDevice9 IDirect3DIndexBuffer9 Methods follow: */
HRESULT
WINAPI
IDirect3DDevice9Impl_CreateIndexBuffer
(
IDirect3DDevice9Ex
*
iface
,
UINT
Length
,
DWORD
Usage
,
D3DFORMAT
Format
,
D3DPOOL
Pool
,
IDirect3DIndexBuffer9
**
ppIndexBuffer
,
HANDLE
*
pSharedHandle
)
HRESULT
indexbuffer_init
(
IDirect3DIndexBuffer9Impl
*
buffer
,
IDirect3DDevice9Impl
*
device
,
UINT
size
,
DWORD
usage
,
D3DFORMAT
format
,
D3DPOOL
pool
)
{
IDirect3DIndexBuffer9Impl
*
object
;
IDirect3DDevice9Impl
*
This
=
(
IDirect3DDevice9Impl
*
)
iface
;
HRESULT
hrc
=
D3D_OK
;
TRACE
(
"(%p) Relay
\n
"
,
This
);
/* Allocate the storage for the device */
object
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
object
));
if
(
NULL
==
object
)
{
FIXME
(
"Allocation of memory failed, returning D3DERR_OUTOFVIDEOMEMORY
\n
"
);
return
D3DERR_OUTOFVIDEOMEMORY
;
}
HRESULT
hr
;
object
->
lpVtbl
=
&
Direct3DIndexBuffer9_Vtbl
;
object
->
ref
=
1
;
object
->
format
=
wined3dformat_from_d3dformat
(
Format
);
TRACE
(
"Calling wined3d create index buffer
\n
"
);
buffer
->
lpVtbl
=
&
Direct3DIndexBuffer9_Vtbl
;
buffer
->
ref
=
1
;
buffer
->
format
=
wined3dformat_from_d3dformat
(
format
);
wined3d_mutex_lock
();
hr
c
=
IWineD3DDevice_CreateIndexBuffer
(
This
->
WineD3DDevice
,
Length
,
U
sage
&
WINED3DUSAGE_MASK
,
(
WINED3DPOOL
)
Pool
,
&
object
->
wineD3DIndexBuffer
,
(
IUnknown
*
)
object
);
hr
=
IWineD3DDevice_CreateIndexBuffer
(
device
->
WineD3DDevice
,
size
,
u
sage
&
WINED3DUSAGE_MASK
,
(
WINED3DPOOL
)
pool
,
&
buffer
->
wineD3DIndexBuffer
,
(
IUnknown
*
)
buffer
);
wined3d_mutex_unlock
();
if
(
FAILED
(
hr
))
{
WARN
(
"Failed to create wined3d buffer, hr %#x.
\n
"
,
hr
);
return
hr
;
}
if
(
hrc
!=
D3D_OK
)
{
buffer
->
parentDevice
=
(
IDirect3DDevice9Ex
*
)
device
;
IDirect3DDevice9Ex_AddRef
(
buffer
->
parentDevice
);
/* free up object */
FIXME
(
"(%p) call to IWineD3DDevice_CreateIndexBuffer failed
\n
"
,
This
);
HeapFree
(
GetProcessHeap
(),
0
,
object
);
}
else
{
IDirect3DDevice9Ex_AddRef
(
iface
);
object
->
parentDevice
=
iface
;
*
ppIndexBuffer
=
(
LPDIRECT3DINDEXBUFFER9
)
object
;
TRACE
(
"(%p) : Created index buffer %p
\n
"
,
This
,
object
);
}
return
hrc
;
return
D3D_OK
;
}
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