Commit a63be635 authored by Rico Schüller's avatar Rico Schüller Committed by Alexandre Julliard

d3dx9: Implement ID3DXEffect::Begin().

parent f37302ed
......@@ -165,6 +165,7 @@ struct ID3DXEffectImpl
LPD3DXEFFECTSTATEMANAGER manager;
LPDIRECT3DDEVICE9 device;
LPD3DXEFFECTPOOL pool;
D3DXHANDLE active_technique;
ID3DXBaseEffect *base_effect;
};
......@@ -2790,13 +2791,32 @@ static BOOL WINAPI ID3DXEffectImpl_IsParameterUsed(ID3DXEffect* iface, D3DXHANDL
return FALSE;
}
static HRESULT WINAPI ID3DXEffectImpl_Begin(ID3DXEffect* iface, UINT *passes, DWORD flags)
static HRESULT WINAPI ID3DXEffectImpl_Begin(ID3DXEffect *iface, UINT *passes, DWORD flags)
{
struct ID3DXEffectImpl *This = impl_from_ID3DXEffect(iface);
struct d3dx_technique *technique = get_technique_struct(This->active_technique);
FIXME("(%p)->(%p, %#x): stub\n", This, passes, flags);
FIXME("iface %p, passes %p, flags %#x partial stub\n", This, passes, flags);
return E_NOTIMPL;
if (passes && technique)
{
if (This->manager || flags & D3DXFX_DONOTSAVESTATE)
{
TRACE("State capturing disabled.\n");
}
else
{
FIXME("State capturing not supported, yet!\n");
}
*passes = technique->pass_count;
return D3D_OK;
}
WARN("Invalid argument supplied.\n");
return D3DERR_INVALIDCALL;
}
static HRESULT WINAPI ID3DXEffectImpl_BeginPass(ID3DXEffect* iface, UINT pass)
......@@ -4988,6 +5008,12 @@ static HRESULT d3dx9_effect_init(struct ID3DXEffectImpl *effect, LPDIRECT3DDEVIC
effect->base_effect = &object->ID3DXBaseEffect_iface;
/* initialize defaults - check because of unsupported ascii effects */
if (object->technique_handles)
{
effect->active_technique = object->technique_handles[0];
}
return D3D_OK;
err_out:
......
......@@ -21,6 +21,12 @@
#ifndef __D3DX9EFFECT_H__
#define __D3DX9EFFECT_H__
#define D3DXFX_DONOTSAVESTATE (1 << 0)
#define D3DXFX_DONOTSAVESHADERSTATE (1 << 1)
#define D3DXFX_DONOTSAVESAMPLERSTATE (1 << 2)
#define D3DXFX_NOT_CLONEABLE (1 << 11)
#define D3DXFX_LARGEADDRESSAWARE (1 << 17)
#define D3DX_PARAMETER_SHARED 1
#define D3DX_PARAMETER_LITERAL 2
#define D3DX_PARAMETER_ANNOTATION 4
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment