2017-05-04 0:33 GMT+02:00 Paul Gofman gofmanp@gmail.com:
if (technique && pass < technique->pass_count && !effect->active_pass) {
HRESULT hr;
effect->active_pass = &technique->passes[pass]; memset(effect->current_light, 0, sizeof(effect->current_light)); memset(&effect->current_material, 0, sizeof(effect->current_material));
return d3dx9_apply_pass_states(effect, effect->active_pass, TRUE);
hr = d3dx9_apply_pass_states(effect, effect->active_pass, TRUE);
if (FAILED(hr))
effect->active_pass = NULL;
}return hr;
Can't you just set active_pass only if d3dx9_apply_pass_states() succeeds, instead?