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
b1bf50d7
Commit
b1bf50d7
authored
Sep 17, 2009
by
Henri Verbeet
Committed by
Alexandre Julliard
Sep 18, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d8: Add a separate function for vertex buffer initialization.
parent
0201ddf2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
51 additions
and
35 deletions
+51
-35
d3d8_private.h
dlls/d3d8/d3d8_private.h
+3
-5
device.c
dlls/d3d8/device.c
+22
-29
vertexbuffer.c
dlls/d3d8/vertexbuffer.c
+26
-1
No files found.
dlls/d3d8/d3d8_private.h
View file @
b1bf50d7
...
...
@@ -319,11 +319,6 @@ struct IDirect3DResource8Impl
/* ---------------------- */
/*****************************************************************************
* Predeclare the interface implementation structures
*/
extern
const
IDirect3DVertexBuffer8Vtbl
Direct3DVertexBuffer8_Vtbl
DECLSPEC_HIDDEN
;
/*****************************************************************************
* IDirect3DVertexBuffer8 implementation structure
*/
struct
IDirect3DVertexBuffer8Impl
...
...
@@ -341,6 +336,9 @@ struct IDirect3DVertexBuffer8Impl
DWORD
fvf
;
};
HRESULT
vertexbuffer_init
(
IDirect3DVertexBuffer8Impl
*
buffer
,
IDirect3DDevice8Impl
*
device
,
UINT
size
,
DWORD
usage
,
DWORD
fvf
,
D3DPOOL
pool
)
DECLSPEC_HIDDEN
;
/* --------------------- */
/* IDirect3DIndexBuffer8 */
/* --------------------- */
...
...
dlls/d3d8/device.c
View file @
b1bf50d7
...
...
@@ -749,42 +749,35 @@ static HRESULT WINAPI IDirect3DDevice8Impl_CreateCubeTexture(IDirect3DDevice8 *i
return
hr
;
}
static
HRESULT
WINAPI
IDirect3DDevice8Impl_CreateVertexBuffer
(
LPDIRECT3DDEVICE8
iface
,
UINT
Size
,
DWORD
Usage
,
DWORD
FVF
,
D3DPOOL
Pool
,
IDirect3DVertexBuffer8
**
ppVertexBuffer
)
{
IDirect3DVertexBuffer8Impl
*
object
;
static
HRESULT
WINAPI
IDirect3DDevice8Impl_CreateVertexBuffer
(
IDirect3DDevice8
*
iface
,
UINT
size
,
DWORD
usage
,
DWORD
fvf
,
D3DPOOL
pool
,
IDirect3DVertexBuffer8
**
buffer
)
{
IDirect3DDevice8Impl
*
This
=
(
IDirect3DDevice8Impl
*
)
iface
;
HRESULT
hrc
=
D3D_OK
;
IDirect3DVertexBuffer8Impl
*
object
;
HRESULT
hr
;
TRACE
(
"(%p) Relay
\n
"
,
This
);
/* Allocate the storage for the device */
object
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
IDirect3DVertexBuffer8Impl
));
if
(
NULL
==
object
)
{
FIXME
(
"Allocation of memory failed
\n
"
);
*
ppVertexBuffer
=
NULL
;
TRACE
(
"iface %p, size %u, usage %#x, fvf %#x, pool %#x, buffer %p.
\n
"
,
iface
,
size
,
usage
,
fvf
,
pool
,
buffer
);
object
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
object
));
if
(
!
object
)
{
ERR
(
"Failed to allocate buffer memory.
\n
"
);
return
D3DERR_OUTOFVIDEOMEMORY
;
}
object
->
lpVtbl
=
&
Direct3DVertexBuffer8_Vtbl
;
object
->
ref
=
1
;
wined3d_mutex_lock
();
hrc
=
IWineD3DDevice_CreateVertexBuffer
(
This
->
WineD3DDevice
,
Size
,
Usage
&
WINED3DUSAGE_MASK
,
0
/* fvf for ddraw only */
,
(
WINED3DPOOL
)
Pool
,
&
object
->
wineD3DVertexBuffer
,
(
IUnknown
*
)
object
);
wined3d_mutex_unlock
();
object
->
fvf
=
FVF
;
if
(
D3D_OK
!=
hrc
)
{
/* free up object */
FIXME
(
"(%p) call to IWineD3DDevice_CreateVertexBuffer failed
\n
"
,
This
);
hr
=
vertexbuffer_init
(
object
,
This
,
size
,
usage
,
fvf
,
pool
);
if
(
FAILED
(
hr
))
{
WARN
(
"Failed to initialize vertex buffer, hr %#x.
\n
"
,
hr
);
HeapFree
(
GetProcessHeap
(),
0
,
object
);
*
ppVertexBuffer
=
NULL
;
}
else
{
IUnknown_AddRef
(
iface
);
object
->
parentDevice
=
iface
;
*
ppVertexBuffer
=
(
LPDIRECT3DVERTEXBUFFER8
)
object
;
return
hr
;
}
return
hrc
;
TRACE
(
"Created vertex buffer %p.
\n
"
,
object
);
*
buffer
=
(
IDirect3DVertexBuffer8
*
)
object
;
return
D3D_OK
;
}
static
HRESULT
WINAPI
IDirect3DDevice8Impl_CreateIndexBuffer
(
IDirect3DDevice8
*
iface
,
UINT
size
,
DWORD
usage
,
...
...
dlls/d3d8/vertexbuffer.c
View file @
b1bf50d7
...
...
@@ -210,7 +210,7 @@ static HRESULT WINAPI IDirect3DVertexBuffer8Impl_GetDesc(LPDIRECT3DVERTEXBUFFER8
return
hr
;
}
const
IDirect3DVertexBuffer8Vtbl
Direct3DVertexBuffer8_Vtbl
=
static
const
IDirect3DVertexBuffer8Vtbl
Direct3DVertexBuffer8_Vtbl
=
{
/* IUnknown */
IDirect3DVertexBuffer8Impl_QueryInterface
,
...
...
@@ -230,3 +230,28 @@ const IDirect3DVertexBuffer8Vtbl Direct3DVertexBuffer8_Vtbl =
IDirect3DVertexBuffer8Impl_Unlock
,
IDirect3DVertexBuffer8Impl_GetDesc
};
HRESULT
vertexbuffer_init
(
IDirect3DVertexBuffer8Impl
*
buffer
,
IDirect3DDevice8Impl
*
device
,
UINT
size
,
DWORD
usage
,
DWORD
fvf
,
D3DPOOL
pool
)
{
HRESULT
hr
;
buffer
->
lpVtbl
=
&
Direct3DVertexBuffer8_Vtbl
;
buffer
->
ref
=
1
;
buffer
->
fvf
=
fvf
;
wined3d_mutex_lock
();
hr
=
IWineD3DDevice_CreateVertexBuffer
(
device
->
WineD3DDevice
,
size
,
usage
&
WINED3DUSAGE_MASK
,
0
,
(
WINED3DPOOL
)
pool
,
&
buffer
->
wineD3DVertexBuffer
,
(
IUnknown
*
)
buffer
);
wined3d_mutex_unlock
();
if
(
FAILED
(
hr
))
{
WARN
(
"Failed to create wined3d buffer, hr %#x.
\n
"
,
hr
);
return
hr
;
}
buffer
->
parentDevice
=
(
IDirect3DDevice8
*
)
device
;
IUnknown_AddRef
(
buffer
->
parentDevice
);
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