/*
* IDirect3DVertexDeclaration9 implementation
*
* Copyright 2002-2003 Raphael Junqueira
* Jason Edmeades
*
* 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
/*
* Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
* other than GPL or LGPL is available it will apply instead, Oracle elects to use only
* the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
* a choice of LGPL license versions is made available with the language indicating
* that LGPLv2 or any later version may be used, or where a choice of which version
* of the LGPL is applied is otherwise unspecified.
*/
#include "config.h"
#include "d3d9_private.h"
static const struct
{
unsigned int component_count;
unsigned int component_size;
}
d3d_dtype_lookup[] =
{
};
static inline struct d3d9_vertex_declaration *impl_from_IDirect3DVertexDeclaration9(IDirect3DVertexDeclaration9 *iface)
{
}
unsigned int offset;
(fvf & D3DFVF_LASTBETA_D3DCOLOR) ||
(fvf & D3DFVF_LASTBETA_UBYTE4));
unsigned int size;
if (has_blend_idx) num_blends--;
/* Compute declaration size */
/* convert the declaration */
if (!elements) return D3DERR_OUTOFVIDEOMEMORY;
idx = 0;
if (has_pos) {
}
}
else {
}
idx++;
}
if (has_blend && (num_blends > 0)) {
else {
switch(num_blends) {
default:
}
}
idx++;
}
if (has_blend_idx) {
if (fvf & D3DFVF_LASTBETA_UBYTE4 ||
else if (fvf & D3DFVF_LASTBETA_D3DCOLOR)
else
idx++;
}
if (has_normal) {
idx++;
}
if (has_psize) {
idx++;
}
if (has_diffuse) {
idx++;
}
if (has_specular) {
idx++;
}
switch (numcoords) {
case D3DFVF_TEXTUREFORMAT1:
break;
case D3DFVF_TEXTUREFORMAT2:
break;
case D3DFVF_TEXTUREFORMAT3:
break;
case D3DFVF_TEXTUREFORMAT4:
break;
}
idx++;
}
/* Now compute offsets, and initialize the rest of the fields */
}
return D3D_OK;
}
{
{
return S_OK;
}
return E_NOINTERFACE;
}
{
if (refcount == 1)
{
}
return refcount;
}
{
if (!refcount)
{
/* Release the device last, as it may cause the device to be destroyed. */
}
return refcount;
}
static HRESULT WINAPI d3d9_vertex_declaration_GetDevice(IDirect3DVertexDeclaration9 *iface, IDirect3DDevice9 **device)
{
return D3D_OK;
}
{
/* Passing a NULL elements is used to just retrieve the number of elements */
if (!elements)
return D3D_OK;
memcpy(elements, declaration->elements, sizeof(*declaration->elements) * declaration->element_count);
return D3D_OK;
}
{
/* IUnknown */
/* IDirect3DVertexDeclaration9 */
};
struct d3d9_vertex_declaration *unsafe_impl_from_IDirect3DVertexDeclaration9(IDirect3DVertexDeclaration9 *iface)
{
if (!iface)
return NULL;
}
{
}
{
};
{
UINT i;
/* Skip the END element */
--count;
if (!*wined3d_elements) {
FIXME("Memory allocation failed\n");
return D3DERR_OUTOFVIDEOMEMORY;
}
for (i = 0; i < count; ++i)
{
{
return E_FAIL;
}
(*wined3d_elements)[i].output_slot = ~0U;
}
*element_count = count;
return D3D_OK;
}
{
{
return hr;
}
declaration->elements = HeapAlloc(GetProcessHeap(), 0, element_count * sizeof(*declaration->elements));
if (!declaration->elements)
{
ERR("Failed to allocate vertex declaration elements memory.\n");
return D3DERR_OUTOFVIDEOMEMORY;
}
hr = wined3d_vertex_declaration_create(device->wined3d_device, wined3d_elements, wined3d_element_count,
{
return hr;
}
return D3D_OK;
}
{
if (!object)
return E_OUTOFMEMORY;
{
return hr;
}
*declaration = object;
return D3D_OK;
}