示例#1
0
        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);
        }
示例#2
0
        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);
            }
        }
示例#3
0
 private static extern void DrawRenderTexture(IntPtr Pointer, IntPtr RenderTexturePointer, ref RenderStatesMarshal RenderStates);
示例#4
0
 private static extern void DrawRenderWindow(IntPtr Pointer, IntPtr RenderWindowPointer, ref RenderStatesMarshal RenderStates);