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
73e8baff
Commit
73e8baff
authored
Nov 24, 2004
by
Jason Edmeades
Committed by
Alexandre Julliard
Nov 24, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add indexbuffer support into wined3d.
parent
aa758eaf
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
257 additions
and
46 deletions
+257
-46
d3d9_private.h
dlls/d3d9/d3d9_private.h
+1
-7
indexbuffer.c
dlls/d3d9/indexbuffer.c
+16
-37
vertexbuffer.c
dlls/d3d9/vertexbuffer.c
+0
-1
Makefile.in
dlls/wined3d/Makefile.in
+1
-0
device.c
dlls/wined3d/device.c
+28
-0
indexbuffer.c
dlls/wined3d/indexbuffer.c
+142
-0
vertexbuffer.c
dlls/wined3d/vertexbuffer.c
+1
-1
wined3d_private.h
dlls/wined3d/wined3d_private.h
+17
-0
wined3d_interface.h
include/wine/wined3d_interface.h
+51
-0
No files found.
dlls/d3d9/d3d9_private.h
View file @
73e8baff
...
...
@@ -639,7 +639,6 @@ struct IDirect3DVertexBuffer9Impl
/* IDirect3DResource9 fields */
IWineD3DVertexBuffer
*
wineD3DVertexBuffer
;
IDirect3DDevice9Impl
*
device
;
};
/* IUnknown: */
...
...
@@ -682,12 +681,7 @@ struct IDirect3DIndexBuffer9Impl
DWORD
ref
;
/* IDirect3DResource9 fields */
IDirect3DDevice9Impl
*
Device
;
D3DRESOURCETYPE
ResourceType
;
/* IDirect3DIndexBuffer9 fields */
void
*
allocatedMemory
;
D3DINDEXBUFFER_DESC
myDesc
;
IWineD3DIndexBuffer
*
wineD3DIndexBuffer
;
};
/* IUnknown: */
...
...
dlls/d3d9/indexbuffer.c
View file @
73e8baff
/*
* IDirect3DIndexBuffer9 implementation
*
* Copyright 2002-200
3
Jason Edmeades
* Copyright 2002-200
4
Jason Edmeades
* Raphael Junqueira
*
* This library is free software; you can redistribute it and/or
...
...
@@ -43,15 +43,15 @@ HRESULT WINAPI IDirect3DIndexBuffer9Impl_QueryInterface(LPDIRECT3DINDEXBUFFER9 i
ULONG
WINAPI
IDirect3DIndexBuffer9Impl_AddRef
(
LPDIRECT3DINDEXBUFFER9
iface
)
{
IDirect3DIndexBuffer9Impl
*
This
=
(
IDirect3DIndexBuffer9Impl
*
)
iface
;
TRACE
(
"(%p) : AddRef from %ld
\n
"
,
This
,
This
->
ref
);
return
++
(
This
->
ref
);
return
InterlockedIncrement
(
&
This
->
ref
);
}
ULONG
WINAPI
IDirect3DIndexBuffer9Impl_Release
(
LPDIRECT3DINDEXBUFFER9
iface
)
{
IDirect3DIndexBuffer9Impl
*
This
=
(
IDirect3DIndexBuffer9Impl
*
)
iface
;
ULONG
ref
=
--
This
->
ref
;
ULONG
ref
=
InterlockedDecrement
(
&
This
->
ref
)
;
TRACE
(
"(%p) : ReleaseRef to %ld
\n
"
,
This
,
This
->
ref
);
if
(
ref
==
0
)
{
HeapFree
(
GetProcessHeap
(),
0
,
This
->
allocatedMemory
);
IWineD3DIndexBuffer_Release
(
This
->
wineD3DIndexBuffer
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
}
return
ref
;
...
...
@@ -65,61 +65,54 @@ HRESULT WINAPI IDirect3DIndexBuffer9Impl_GetDevice(LPDIRECT3DINDEXBUFFER9 iface,
HRESULT
WINAPI
IDirect3DIndexBuffer9Impl_SetPrivateData
(
LPDIRECT3DINDEXBUFFER9
iface
,
REFGUID
refguid
,
CONST
void
*
pData
,
DWORD
SizeOfData
,
DWORD
Flags
)
{
IDirect3DIndexBuffer9Impl
*
This
=
(
IDirect3DIndexBuffer9Impl
*
)
iface
;
FIXME
(
"(%p) : stub
\n
"
,
This
);
return
D3D_OK
;
return
IWineD3DIndexBuffer_SetPrivateData
(
This
->
wineD3DIndexBuffer
,
refguid
,
pData
,
SizeOfData
,
Flags
);
}
HRESULT
WINAPI
IDirect3DIndexBuffer9Impl_GetPrivateData
(
LPDIRECT3DINDEXBUFFER9
iface
,
REFGUID
refguid
,
void
*
pData
,
DWORD
*
pSizeOfData
)
{
IDirect3DIndexBuffer9Impl
*
This
=
(
IDirect3DIndexBuffer9Impl
*
)
iface
;
FIXME
(
"(%p) : stub
\n
"
,
This
);
return
D3D_OK
;
return
IWineD3DIndexBuffer_GetPrivateData
(
This
->
wineD3DIndexBuffer
,
refguid
,
pData
,
pSizeOfData
);
}
HRESULT
WINAPI
IDirect3DIndexBuffer9Impl_FreePrivateData
(
LPDIRECT3DINDEXBUFFER9
iface
,
REFGUID
refguid
)
{
IDirect3DIndexBuffer9Impl
*
This
=
(
IDirect3DIndexBuffer9Impl
*
)
iface
;
FIXME
(
"(%p) : stub
\n
"
,
This
);
return
D3D_OK
;
return
IWineD3DIndexBuffer_FreePrivateData
(
This
->
wineD3DIndexBuffer
,
refguid
);
}
DWORD
WINAPI
IDirect3DIndexBuffer9Impl_SetPriority
(
LPDIRECT3DINDEXBUFFER9
iface
,
DWORD
PriorityNew
)
{
IDirect3DIndexBuffer9Impl
*
This
=
(
IDirect3DIndexBuffer9Impl
*
)
iface
;
return
I
Direct3DResource9Impl_SetPriority
((
LPDIRECT3DRESOURCE9
)
This
,
PriorityNew
);
return
I
WineD3DIndexBuffer_SetPriority
(
This
->
wineD3DIndexBuffer
,
PriorityNew
);
}
DWORD
WINAPI
IDirect3DIndexBuffer9Impl_GetPriority
(
LPDIRECT3DINDEXBUFFER9
iface
)
{
IDirect3DIndexBuffer9Impl
*
This
=
(
IDirect3DIndexBuffer9Impl
*
)
iface
;
return
I
Direct3DResource9Impl_GetPriority
((
LPDIRECT3DRESOURCE9
)
This
);
return
I
WineD3DIndexBuffer_GetPriority
(
This
->
wineD3DIndexBuffer
);
}
void
WINAPI
IDirect3DIndexBuffer9Impl_PreLoad
(
LPDIRECT3DINDEXBUFFER9
iface
)
{
IDirect3DIndexBuffer9Impl
*
This
=
(
IDirect3DIndexBuffer9Impl
*
)
iface
;
FIXME
(
"(%p) : stub
\n
"
,
This
);
IWineD3DIndexBuffer_PreLoad
(
This
->
wineD3DIndexBuffer
);
return
;
}
D3DRESOURCETYPE
WINAPI
IDirect3DIndexBuffer9Impl_GetType
(
LPDIRECT3DINDEXBUFFER9
iface
)
{
IDirect3DIndexBuffer9Impl
*
This
=
(
IDirect3DIndexBuffer9Impl
*
)
iface
;
return
I
Direct3DResource9Impl_GetType
((
LPDIRECT3DRESOURCE9
)
This
);
return
I
WineD3DIndexBuffer_GetType
(
This
->
wineD3DIndexBuffer
);
}
/* IDirect3DIndexBuffer9 Interface follow: */
HRESULT
WINAPI
IDirect3DIndexBuffer9Impl_Lock
(
LPDIRECT3DINDEXBUFFER9
iface
,
UINT
OffsetToLock
,
UINT
SizeToLock
,
void
**
ppbData
,
DWORD
Flags
)
{
IDirect3DIndexBuffer9Impl
*
This
=
(
IDirect3DIndexBuffer9Impl
*
)
iface
;
FIXME
(
"(%p) : stub
\n
"
,
This
);
return
D3D_OK
;
return
IWineD3DIndexBuffer_Lock
(
This
->
wineD3DIndexBuffer
,
OffsetToLock
,
SizeToLock
,
(
BYTE
**
)
ppbData
,
Flags
);
}
HRESULT
WINAPI
IDirect3DIndexBuffer9Impl_Unlock
(
LPDIRECT3DINDEXBUFFER9
iface
)
{
IDirect3DIndexBuffer9Impl
*
This
=
(
IDirect3DIndexBuffer9Impl
*
)
iface
;
FIXME
(
"(%p) : stub
\n
"
,
This
);
return
D3D_OK
;
return
IWineD3DIndexBuffer_Unlock
(
This
->
wineD3DIndexBuffer
);
}
HRESULT
WINAPI
IDirect3DIndexBuffer9Impl_GetDesc
(
LPDIRECT3DINDEXBUFFER9
iface
,
D3DINDEXBUFFER_DESC
*
pDesc
)
{
IDirect3DIndexBuffer9Impl
*
This
=
(
IDirect3DIndexBuffer9Impl
*
)
iface
;
TRACE
(
"(%p) : copying into %p
\n
"
,
This
,
pDesc
);
memcpy
(
pDesc
,
&
This
->
myDesc
,
sizeof
(
D3DINDEXBUFFER_DESC
));
return
D3D_OK
;
return
IWineD3DIndexBuffer_GetDesc
(
This
->
wineD3DIndexBuffer
,
pDesc
);
}
...
...
@@ -146,30 +139,16 @@ IDirect3DIndexBuffer9Vtbl Direct3DIndexBuffer9_Vtbl =
HRESULT
WINAPI
IDirect3DDevice9Impl_CreateIndexBuffer
(
LPDIRECT3DDEVICE9
iface
,
UINT
Length
,
DWORD
Usage
,
D3DFORMAT
Format
,
D3DPOOL
Pool
,
IDirect3DIndexBuffer9
**
ppIndexBuffer
,
HANDLE
*
pSharedHandle
)
{
IDirect3DIndexBuffer9Impl
*
object
;
IDirect3DIndexBuffer9Impl
*
object
;
IDirect3DDevice9Impl
*
This
=
(
IDirect3DDevice9Impl
*
)
iface
;
/*TRACE("(%p) : Len=%d, Use=%lx, Format=(%u,%s), Pool=%d\n", This, Length, Usage, Format, debug_d3dformat(Format), Pool);*/
/* Allocate the storage for the device */
object
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
IDirect3DIndexBuffer9Impl
));
object
->
lpVtbl
=
&
Direct3DIndexBuffer9_Vtbl
;
object
->
ref
=
1
;
object
->
Device
=
This
;
object
->
ResourceType
=
D3DRTYPE_INDEXBUFFER
;
object
->
allocatedMemory
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
Length
);
object
->
myDesc
.
Type
=
D3DRTYPE_INDEXBUFFER
;
object
->
myDesc
.
Usage
=
Usage
;
object
->
myDesc
.
Pool
=
Pool
;
object
->
myDesc
.
Format
=
Format
;
object
->
myDesc
.
Size
=
Length
;
TRACE
(
"(%p) : Iface@%p allocatedMem @ %p
\n
"
,
This
,
object
,
object
->
allocatedMemory
);
IWineD3DDevice_CreateIndexBuffer
(
This
->
WineD3DDevice
,
Length
,
Usage
,
Format
,
Pool
,
&
(
object
->
wineD3DIndexBuffer
),
pSharedHandle
,
(
IUnknown
*
)
object
);
*
ppIndexBuffer
=
(
LPDIRECT3DINDEXBUFFER9
)
object
;
return
D3D_OK
;
}
dlls/d3d9/vertexbuffer.c
View file @
73e8baff
...
...
@@ -146,7 +146,6 @@ HRESULT WINAPI IDirect3DDevice9Impl_CreateVertexBuffer(LPDIRECT3DDEVICE9 iface,
object
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
IDirect3DVertexBuffer9Impl
));
object
->
lpVtbl
=
&
Direct3DVertexBuffer9_Vtbl
;
object
->
ref
=
1
;
object
->
device
=
This
;
IWineD3DDevice_CreateVertexBuffer
(
This
->
WineD3DDevice
,
Size
,
Usage
,
FVF
,
Pool
,
&
(
object
->
wineD3DVertexBuffer
),
pSharedHandle
,
(
IUnknown
*
)
object
);
*
ppVertexBuffer
=
(
LPDIRECT3DVERTEXBUFFER9
)
object
;
...
...
dlls/wined3d/Makefile.in
View file @
73e8baff
...
...
@@ -10,6 +10,7 @@ EXTRALIBS = -ldxguid -luuid @X_LIBS@ @X_PRE_LIBS@ @XLIB@ @X_EXTRA_LIBS@ @OPENGL_
C_SRCS
=
\
device.c
\
directx.c
\
indexbuffer.c
\
resource.c
\
stateblock.c
\
utils.c
\
...
...
dlls/wined3d/device.c
View file @
73e8baff
...
...
@@ -68,6 +68,33 @@ HRESULT WINAPI IWineD3DDeviceImpl_CreateVertexBuffer(IWineD3DDevice *iface, UINT
return
D3D_OK
;
}
HRESULT
WINAPI
IWineD3DDeviceImpl_CreateIndexBuffer
(
IWineD3DDevice
*
iface
,
UINT
Length
,
DWORD
Usage
,
D3DFORMAT
Format
,
D3DPOOL
Pool
,
IWineD3DIndexBuffer
**
ppIndexBuffer
,
HANDLE
*
sharedHandle
,
IUnknown
*
parent
)
{
IWineD3DIndexBufferImpl
*
object
;
IWineD3DDeviceImpl
*
This
=
(
IWineD3DDeviceImpl
*
)
iface
;
/* Allocate the storage for the device */
object
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
IWineD3DIndexBufferImpl
));
object
->
lpVtbl
=
&
IWineD3DIndexBuffer_Vtbl
;
object
->
resource
.
wineD3DDevice
=
iface
;
object
->
resource
.
resourceType
=
D3DRTYPE_INDEXBUFFER
;
object
->
resource
.
parent
=
parent
;
IWineD3DDevice_AddRef
(
iface
);
object
->
resource
.
ref
=
1
;
object
->
allocatedMemory
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
Length
);
object
->
currentDesc
.
Usage
=
Usage
;
object
->
currentDesc
.
Pool
=
Pool
;
object
->
currentDesc
.
Format
=
Format
;
object
->
currentDesc
.
Size
=
Length
;
TRACE
(
"(%p) : Len=%d, Use=%lx, Format=(%u,%s), Pool=%d - Memory@%p, Iface@%p
\n
"
,
This
,
Length
,
Usage
,
Format
,
debug_d3dformat
(
Format
),
Pool
,
object
,
object
->
allocatedMemory
);
*
ppIndexBuffer
=
(
IWineD3DIndexBuffer
*
)
object
;
return
D3D_OK
;
}
HRESULT
WINAPI
IWineD3DDeviceImpl_CreateStateBlock
(
IWineD3DDevice
*
iface
,
D3DSTATEBLOCKTYPE
Type
,
IWineD3DStateBlock
**
ppStateBlock
,
IUnknown
*
parent
)
{
IWineD3DDeviceImpl
*
This
=
(
IWineD3DDeviceImpl
*
)
iface
;
...
...
@@ -200,6 +227,7 @@ IWineD3DDeviceVtbl IWineD3DDevice_Vtbl =
IWineD3DDeviceImpl_Release
,
IWineD3DDeviceImpl_GetParent
,
IWineD3DDeviceImpl_CreateVertexBuffer
,
IWineD3DDeviceImpl_CreateIndexBuffer
,
IWineD3DDeviceImpl_CreateStateBlock
,
IWineD3DDeviceImpl_SetFVF
,
IWineD3DDeviceImpl_GetFVF
,
...
...
dlls/wined3d/indexbuffer.c
0 → 100644
View file @
73e8baff
/*
* IWineD3DIndexBuffer Implementation
*
* Copyright 2002-2004 Jason Edmeades
* Copyright 2003-2004 Raphael Junqueira
* Copyright 2004 Christian Costa
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "config.h"
#include "wined3d_private.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
d3d
);
/* *******************************************
IWineD3DIndexBuffer IUnknown parts follow
******************************************* */
HRESULT
WINAPI
IWineD3DIndexBufferImpl_QueryInterface
(
IWineD3DIndexBuffer
*
iface
,
REFIID
riid
,
LPVOID
*
ppobj
)
{
IWineD3DIndexBufferImpl
*
This
=
(
IWineD3DIndexBufferImpl
*
)
iface
;
WARN
(
"(%p)->(%s,%p) should not be called
\n
"
,
This
,
debugstr_guid
(
riid
),
ppobj
);
return
E_NOINTERFACE
;
}
ULONG
WINAPI
IWineD3DIndexBufferImpl_AddRef
(
IWineD3DIndexBuffer
*
iface
)
{
IWineD3DIndexBufferImpl
*
This
=
(
IWineD3DIndexBufferImpl
*
)
iface
;
TRACE
(
"(%p) : AddRef increasing from %ld
\n
"
,
This
,
This
->
resource
.
ref
);
IUnknown_AddRef
(
This
->
resource
.
parent
);
return
InterlockedIncrement
(
&
This
->
resource
.
ref
);
}
ULONG
WINAPI
IWineD3DIndexBufferImpl_Release
(
IWineD3DIndexBuffer
*
iface
)
{
IWineD3DIndexBufferImpl
*
This
=
(
IWineD3DIndexBufferImpl
*
)
iface
;
ULONG
ref
;
TRACE
(
"(%p) : Releasing from %ld
\n
"
,
This
,
This
->
resource
.
ref
);
ref
=
InterlockedDecrement
(
&
This
->
resource
.
ref
);
if
(
ref
==
0
)
{
if
(
NULL
!=
This
->
allocatedMemory
)
HeapFree
(
GetProcessHeap
(),
0
,
This
->
allocatedMemory
);
IWineD3DDevice_Release
(
This
->
resource
.
wineD3DDevice
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
}
else
{
IUnknown_Release
(
This
->
resource
.
parent
);
/* Released the reference to the d3dx VB */
}
return
ref
;
}
/* ****************************************************
IWineD3DIndexBuffer IWineD3DResource parts follow
**************************************************** */
HRESULT
WINAPI
IWineD3DIndexBufferImpl_GetDevice
(
IWineD3DIndexBuffer
*
iface
,
IWineD3DDevice
**
ppDevice
)
{
return
IWineD3DResource_GetDevice
((
IWineD3DResource
*
)
iface
,
ppDevice
);
}
HRESULT
WINAPI
IWineD3DIndexBufferImpl_SetPrivateData
(
IWineD3DIndexBuffer
*
iface
,
REFGUID
refguid
,
CONST
void
*
pData
,
DWORD
SizeOfData
,
DWORD
Flags
)
{
return
IWineD3DResource_SetPrivateData
((
IWineD3DResource
*
)
iface
,
refguid
,
pData
,
SizeOfData
,
Flags
);
}
HRESULT
WINAPI
IWineD3DIndexBufferImpl_GetPrivateData
(
IWineD3DIndexBuffer
*
iface
,
REFGUID
refguid
,
void
*
pData
,
DWORD
*
pSizeOfData
)
{
return
IWineD3DResource_GetPrivateData
((
IWineD3DResource
*
)
iface
,
refguid
,
pData
,
pSizeOfData
);
}
HRESULT
WINAPI
IWineD3DIndexBufferImpl_FreePrivateData
(
IWineD3DIndexBuffer
*
iface
,
REFGUID
refguid
)
{
return
IWineD3DResource_FreePrivateData
((
IWineD3DResource
*
)
iface
,
refguid
);
}
DWORD
WINAPI
IWineD3DIndexBufferImpl_SetPriority
(
IWineD3DIndexBuffer
*
iface
,
DWORD
PriorityNew
)
{
return
IWineD3DResource_SetPriority
((
IWineD3DResource
*
)
iface
,
PriorityNew
);
}
DWORD
WINAPI
IWineD3DIndexBufferImpl_GetPriority
(
IWineD3DIndexBuffer
*
iface
)
{
return
IWineD3DResource_GetPriority
((
IWineD3DResource
*
)
iface
);
}
void
WINAPI
IWineD3DIndexBufferImpl_PreLoad
(
IWineD3DIndexBuffer
*
iface
)
{
return
IWineD3DResource_PreLoad
((
IWineD3DResource
*
)
iface
);
}
D3DRESOURCETYPE
WINAPI
IWineD3DIndexBufferImpl_GetType
(
IWineD3DIndexBuffer
*
iface
)
{
return
IWineD3DResource_GetType
((
IWineD3DResource
*
)
iface
);
}
HRESULT
WINAPI
IWineD3DIndexBufferImpl_GetParent
(
IWineD3DIndexBuffer
*
iface
,
IUnknown
**
pParent
)
{
return
IWineD3DResource_GetParent
((
IWineD3DResource
*
)
iface
,
pParent
);
}
/* ******************************************************
IWineD3DIndexBuffer IWineD3DIndexBuffer parts follow
****************************************************** */
HRESULT
WINAPI
IWineD3DIndexBufferImpl_Lock
(
IWineD3DIndexBuffer
*
iface
,
UINT
OffsetToLock
,
UINT
SizeToLock
,
BYTE
**
ppbData
,
DWORD
Flags
)
{
IWineD3DIndexBufferImpl
*
This
=
(
IWineD3DIndexBufferImpl
*
)
iface
;
TRACE
(
"(%p) : no real locking yet, offset %d, size %d, Flags=%lx
\n
"
,
This
,
OffsetToLock
,
SizeToLock
,
Flags
);
*
ppbData
=
(
BYTE
*
)
This
->
allocatedMemory
+
OffsetToLock
;
return
D3D_OK
;
}
HRESULT
WINAPI
IWineD3DIndexBufferImpl_Unlock
(
IWineD3DIndexBuffer
*
iface
)
{
IWineD3DIndexBufferImpl
*
This
=
(
IWineD3DIndexBufferImpl
*
)
iface
;
TRACE
(
"(%p) : stub
\n
"
,
This
);
return
D3D_OK
;
}
HRESULT
WINAPI
IWineD3DIndexBufferImpl_GetDesc
(
IWineD3DIndexBuffer
*
iface
,
D3DINDEXBUFFER_DESC
*
pDesc
)
{
IWineD3DIndexBufferImpl
*
This
=
(
IWineD3DIndexBufferImpl
*
)
iface
;
TRACE
(
"(%p)
\n
"
,
This
);
pDesc
->
Format
=
This
->
currentDesc
.
Format
;
pDesc
->
Type
=
This
->
resource
.
resourceType
;
pDesc
->
Usage
=
This
->
currentDesc
.
Usage
;
pDesc
->
Pool
=
This
->
currentDesc
.
Pool
;
pDesc
->
Size
=
This
->
currentDesc
.
Size
;
return
D3D_OK
;
}
IWineD3DIndexBufferVtbl
IWineD3DIndexBuffer_Vtbl
=
{
IWineD3DIndexBufferImpl_QueryInterface
,
IWineD3DIndexBufferImpl_AddRef
,
IWineD3DIndexBufferImpl_Release
,
IWineD3DIndexBufferImpl_GetParent
,
IWineD3DIndexBufferImpl_GetDevice
,
IWineD3DIndexBufferImpl_SetPrivateData
,
IWineD3DIndexBufferImpl_GetPrivateData
,
IWineD3DIndexBufferImpl_FreePrivateData
,
IWineD3DIndexBufferImpl_SetPriority
,
IWineD3DIndexBufferImpl_GetPriority
,
IWineD3DIndexBufferImpl_PreLoad
,
IWineD3DIndexBufferImpl_GetType
,
IWineD3DIndexBufferImpl_Lock
,
IWineD3DIndexBufferImpl_Unlock
,
IWineD3DIndexBufferImpl_GetDesc
};
dlls/wined3d/vertexbuffer.c
View file @
73e8baff
...
...
@@ -116,7 +116,7 @@ HRESULT WINAPI IWineD3DVertexBufferImpl_GetDesc(IWineD3DVertexBuffer *if
TRACE
(
"(%p)
\n
"
,
This
);
pDesc
->
Format
=
This
->
currentDesc
.
Format
;
pDesc
->
Type
=
This
->
currentDesc
.
Type
;
pDesc
->
Type
=
This
->
resource
.
resource
Type
;
pDesc
->
Usage
=
This
->
currentDesc
.
Usage
;
pDesc
->
Pool
=
This
->
currentDesc
.
Pool
;
pDesc
->
Size
=
This
->
currentDesc
.
Size
;
...
...
dlls/wined3d/wined3d_private.h
View file @
73e8baff
...
...
@@ -196,6 +196,23 @@ typedef struct IWineD3DVertexBufferImpl
extern
IWineD3DVertexBufferVtbl
IWineD3DVertexBuffer_Vtbl
;
/*****************************************************************************
* IWineD3DIndexBuffer implementation structure (extends IWineD3DResourceImpl)
*/
typedef
struct
IWineD3DIndexBufferImpl
{
/* IUnknown & WineD3DResource Information */
IWineD3DIndexBufferVtbl
*
lpVtbl
;
IWineD3DResourceClass
resource
;
/* WineD3DVertexBuffer specifics */
BYTE
*
allocatedMemory
;
D3DINDEXBUFFER_DESC
currentDesc
;
}
IWineD3DIndexBufferImpl
;
extern
IWineD3DIndexBufferVtbl
IWineD3DIndexBuffer_Vtbl
;
/*****************************************************************************
* IWineD3DStateBlock implementation structure
*/
...
...
include/wine/wined3d_interface.h
View file @
73e8baff
...
...
@@ -74,6 +74,7 @@ typedef struct IWineD3D IWineD3D;
typedef
struct
IWineD3DDevice
IWineD3DDevice
;
typedef
struct
IWineD3DResource
IWineD3DResource
;
typedef
struct
IWineD3DVertexBuffer
IWineD3DVertexBuffer
;
typedef
struct
IWineD3DIndexBuffer
IWineD3DIndexBuffer
;
typedef
struct
IWineD3DStateBlock
IWineD3DStateBlock
;
/*****************************************************************************
...
...
@@ -145,6 +146,7 @@ DECLARE_INTERFACE_(IWineD3DDevice,IUnknown)
/*** IWineD3D methods ***/
STDMETHOD
(
GetParent
)(
THIS_
IUnknown
**
pParent
)
PURE
;
STDMETHOD
(
CreateVertexBuffer
)(
THIS_
UINT
Length
,
DWORD
Usage
,
DWORD
FVF
,
D3DPOOL
Pool
,
IWineD3DVertexBuffer
**
ppVertexBuffer
,
HANDLE
*
sharedHandle
,
IUnknown
*
parent
)
PURE
;
STDMETHOD
(
CreateIndexBuffer
)(
THIS_
UINT
Length
,
DWORD
Usage
,
D3DFORMAT
Format
,
D3DPOOL
Pool
,
IWineD3DIndexBuffer
**
ppIndexBuffer
,
HANDLE
*
pSharedHandle
,
IUnknown
*
parent
)
PURE
;
STDMETHOD
(
CreateStateBlock
)(
THIS_
D3DSTATEBLOCKTYPE
Type
,
IWineD3DStateBlock
**
ppStateBlock
,
IUnknown
*
parent
)
PURE
;
STDMETHOD
(
SetFVF
)(
THIS_
DWORD
fvf
)
PURE
;
STDMETHOD
(
GetFVF
)(
THIS_
DWORD
*
pfvf
)
PURE
;
...
...
@@ -161,6 +163,7 @@ DECLARE_INTERFACE_(IWineD3DDevice,IUnknown)
/*** IWineD3DDevice methods ***/
#define IWineD3DDevice_GetParent(p,a) (p)->lpVtbl->GetParent(p,a)
#define IWineD3DDevice_CreateVertexBuffer(p,a,b,c,d,e,f,g) (p)->lpVtbl->CreateVertexBuffer(p,a,b,c,d,e,f,g)
#define IWineD3DDevice_CreateIndexBuffer(p,a,b,c,d,e,f,g) (p)->lpVtbl->CreateIndexBuffer(p,a,b,c,d,e,f,g)
#define IWineD3DDevice_CreateStateBlock(p,a,b,c) (p)->lpVtbl->CreateStateBlock(p,a,b,c)
#define IWineD3DDevice_SetFVF(p,a) (p)->lpVtbl->SetFVF(p,a)
#define IWineD3DDevice_GetFVF(p,a) (p)->lpVtbl->GetFVF(p,a)
...
...
@@ -257,6 +260,54 @@ DECLARE_INTERFACE_(IWineD3DVertexBuffer,IDirect3DResource8)
#endif
/*****************************************************************************
* WineD3DIndexBuffer interface
*/
#define INTERFACE IWineD3DIndexBuffer
DECLARE_INTERFACE_
(
IWineD3DIndexBuffer
,
IDirect3DResource8
)
{
/*** IUnknown methods ***/
STDMETHOD_
(
HRESULT
,
QueryInterface
)(
THIS_
REFIID
riid
,
void
**
ppvObject
)
PURE
;
STDMETHOD_
(
ULONG
,
AddRef
)(
THIS
)
PURE
;
STDMETHOD_
(
ULONG
,
Release
)(
THIS
)
PURE
;
/*** IWineD3DResource methods ***/
STDMETHOD
(
GetParent
)(
THIS_
IUnknown
**
pParent
)
PURE
;
STDMETHOD
(
GetDevice
)(
THIS_
IWineD3DDevice
**
ppDevice
)
PURE
;
STDMETHOD
(
SetPrivateData
)(
THIS_
REFGUID
refguid
,
CONST
void
*
pData
,
DWORD
SizeOfData
,
DWORD
Flags
)
PURE
;
STDMETHOD
(
GetPrivateData
)(
THIS_
REFGUID
refguid
,
void
*
pData
,
DWORD
*
pSizeOfData
)
PURE
;
STDMETHOD
(
FreePrivateData
)(
THIS_
REFGUID
refguid
)
PURE
;
STDMETHOD_
(
DWORD
,
SetPriority
)(
THIS_
DWORD
PriorityNew
)
PURE
;
STDMETHOD_
(
DWORD
,
GetPriority
)(
THIS
)
PURE
;
STDMETHOD_
(
void
,
PreLoad
)(
THIS
)
PURE
;
STDMETHOD_
(
D3DRESOURCETYPE
,
GetType
)(
THIS
)
PURE
;
/*** IWineD3DIndexBuffer methods ***/
STDMETHOD
(
Lock
)(
THIS_
UINT
OffsetToLock
,
UINT
SizeToLock
,
BYTE
**
ppbData
,
DWORD
Flags
)
PURE
;
STDMETHOD
(
Unlock
)(
THIS
)
PURE
;
STDMETHOD
(
GetDesc
)(
THIS_
D3DINDEXBUFFER_DESC
*
pDesc
)
PURE
;
};
#undef INTERFACE
#if !defined(__cplusplus) || defined(CINTERFACE)
/*** IUnknown methods ***/
#define IWineD3DIndexBuffer_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
#define IWineD3DIndexBuffer_AddRef(p) (p)->lpVtbl->AddRef(p)
#define IWineD3DIndexBuffer_Release(p) (p)->lpVtbl->Release(p)
/*** IWineD3DResource methods ***/
#define IWineD3DIndexBuffer_GetParent(p,a) (p)->lpVtbl->GetParent(p,a)
#define IWineD3DIndexBuffer_GetDevice(p,a) (p)->lpVtbl->GetDevice(p,a)
#define IWineD3DIndexBuffer_SetPrivateData(p,a,b,c,d) (p)->lpVtbl->SetPrivateData(p,a,b,c,d)
#define IWineD3DIndexBuffer_GetPrivateData(p,a,b,c) (p)->lpVtbl->GetPrivateData(p,a,b,c)
#define IWineD3DIndexBuffer_FreePrivateData(p,a) (p)->lpVtbl->FreePrivateData(p,a)
#define IWineD3DIndexBuffer_SetPriority(p,a) (p)->lpVtbl->SetPriority(p,a)
#define IWineD3DIndexBuffer_GetPriority(p) (p)->lpVtbl->GetPriority(p)
#define IWineD3DIndexBuffer_PreLoad(p) (p)->lpVtbl->PreLoad(p)
#define IWineD3DIndexBuffer_GetType(p) (p)->lpVtbl->GetType(p)
/*** IWineD3DIndexBuffer methods ***/
#define IWineD3DIndexBuffer_Lock(p,a,b,c,d) (p)->lpVtbl->Lock(p,a,b,c,d)
#define IWineD3DIndexBuffer_Unlock(p) (p)->lpVtbl->Unlock(p)
#define IWineD3DIndexBuffer_GetDesc(p,a) (p)->lpVtbl->GetDesc(p,a)
#endif
/*****************************************************************************
* WineD3DStateBlock interface
*/
#define INTERFACE IWineD3DStateBlock
...
...
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