public static RenderStatesMarshal MarshalRenderStates(this RenderStates States) { RenderStatesMarshal marshal = new RenderStatesMarshal(); marshal.BlendMode = States.BlendMode; marshal.Transform = States.Transform; marshal.Texture = States.Texture != null ? States.Texture.CPointer : IntPtr.Zero; marshal.Shader = States.Shader != null ? States.Shader.CPointer : IntPtr.Zero; return(marshal); }
public void Draw(RenderTarget target, RenderStates states) { _base.EnsureValid(); states.Transform *= Transform; RenderStatesMarshal marshaledstates = states.MarshalRenderStates(); if (target is RenderWindow) { DrawRenderWindow(_pointer, ((RenderWindow)target).CPointer, ref marshaledstates); } else if (target is RenderTexture) { DrawRenderTexture(_pointer, ((RenderTexture)target).CPointer, ref marshaledstates); } }
private static extern void DrawRenderTexture(IntPtr Pointer, IntPtr RenderTexturePointer, ref RenderStatesMarshal RenderStates);
private static extern void DrawRenderWindow(IntPtr Pointer, IntPtr RenderWindowPointer, ref RenderStatesMarshal RenderStates);