Example #1
0
        //Example if you want to subscribe to an event fired by Wyphon
        //wyphon.Toggle += new Wyphon.WyphonPartherJoinedHandler(DoubleBufferChanged);
        /// <summary>
        /// 
        /// </summary>
        /// <param name="name">the name of our application that is communicated to the other partners</param>
        public WyphonPartner(string name)
        {
            wyphonPartnerJoinedCallbackDelegate = WyphonPartnerJoinedCallback;
            wyphonPartnerLeftCallbackDelegate = WyphonPartnerLeftCallback;
            d3dTextureSharingStartedCallbackDelegate = D3DTextureSharingStartedCallback;
            d3dTextureSharingStoppedCallbackDelegate = D3DTextureSharingStoppedCallback;

            wyphonPartnerHandle = CreateWyphonPartner(name, IntPtr.Zero,
                                                      Marshal.GetFunctionPointerForDelegate(wyphonPartnerJoinedCallbackDelegate),
                                                      Marshal.GetFunctionPointerForDelegate(wyphonPartnerLeftCallbackDelegate),
                                                      Marshal.GetFunctionPointerForDelegate(d3dTextureSharingStartedCallbackDelegate),
                                                      Marshal.GetFunctionPointerForDelegate(d3dTextureSharingStoppedCallbackDelegate)
                                                     );
        }
Example #2
0
        //Example if you want to subscribe to an event fired by Wyphon
        //wyphon.Toggle += new Wyphon.WyphonPartherJoinedHandler(DoubleBufferChanged);

        /// <summary>
        ///
        /// </summary>
        /// <param name="name">the name of our application that is communicated to the other partners</param>
        public WyphonPartner(string name)
        {
            wyphonPartnerJoinedCallbackDelegate      = WyphonPartnerJoinedCallback;
            wyphonPartnerLeftCallbackDelegate        = WyphonPartnerLeftCallback;
            d3dTextureSharingStartedCallbackDelegate = D3DTextureSharingStartedCallback;
            d3dTextureSharingStoppedCallbackDelegate = D3DTextureSharingStoppedCallback;

            wyphonPartnerHandle = CreateWyphonPartner(name, IntPtr.Zero,
                                                      Marshal.GetFunctionPointerForDelegate(wyphonPartnerJoinedCallbackDelegate),
                                                      Marshal.GetFunctionPointerForDelegate(wyphonPartnerLeftCallbackDelegate),
                                                      Marshal.GetFunctionPointerForDelegate(d3dTextureSharingStartedCallbackDelegate),
                                                      Marshal.GetFunctionPointerForDelegate(d3dTextureSharingStoppedCallbackDelegate)
                                                      );
        }