/// <summary> /// Enables the GL.BlendFunc parameter /// </summary> /// <param name="type"></param> /// <param name="stateHandle"></param> private static void EnableBlendFunc(D3DRENDERSTATETYPE type, MaterialShader.RenderStateHandle stateHandle) { var other = type == D3DRENDERSTATETYPE.SRCBLEND ? D3DRENDERSTATETYPE.DESTBLEND : D3DRENDERSTATETYPE.SRCBLEND; int value = CurrentState.TryGetValue(other, out value) ? value : 0; var otherBlend = ( D3DBLEND )value; var blend = ( D3DBLEND )stateHandle.UnionValue; if (other == D3DRENDERSTATETYPE.SRCBLEND) { GL.BlendFunc(otherBlend.ConvertToBlendingFactorSrc( ), blend.ConvertToBlendingFactorDest( )); } else { GL.BlendFunc(blend.ConvertToBlendingFactorSrc( ), otherBlend.ConvertToBlendingFactorDest( )); } }
public HRESULT SetRenderState(D3DRENDERSTATETYPE renderState, bool enable) { return(SetRenderState(renderState, enable ? 1 : 0)); }
public unsafe HRESULT SetRenderState(D3DRENDERSTATETYPE renderState, float value) { return(SetRenderState(renderState, *(int *)(&value))); }
/// <unmanaged>HRESULT IDirect3DDevice9::SetRenderState([In] D3DRENDERSTATETYPE State,[In] unsigned int Value)</unmanaged> public unsafe HRESULT SetRenderState(D3DRENDERSTATETYPE state, int value) { //calli(System.Int32(System.Void*,System.Int32,System.Int32), this._nativePointer, state, value, *(*(IntPtr*)this._nativePointer + (IntPtr)57 * (IntPtr)sizeof(void*))).CheckError(); return((HRESULT)NativeHelper.CalliInt32(57, _nativePointer, (int)state, (int)value)); }