public GDISendingChannel(GDIDeviceContext dc) { fFormatter = new BinaryFormatter(); fMemoryStream = new MemoryStream(2048); fDeviceContext = dc; // Create the client fGDISpeaker = new UdpClient(); // Create the broadcast socket IPAddress ip = IPAddress.Parse(GDIPortal.Multicast_Pixtour_Group); fBroadcastSocket = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp); fBroadcastSocket.SetSocketOption(SocketOptionLevel.IP, SocketOptionName.AddMembership, new MulticastOption(ip)); fBroadcastSocket.SetSocketOption(SocketOptionLevel.IP, SocketOptionName.MulticastTimeToLive, 255); IPEndPoint ipep = new IPEndPoint(IPAddress.Parse(GDIPortal.Multicast_Pixtour_Group), GDIPortal.Multicast_Pixtour_Port); fBroadcastSocket.Connect(ipep); // Setup the speaker fGraphPort = new GCDelegate(fDeviceContext.Resolution); fGraphPort.CommandPacked += new GCDelegate.DrawCommandProc(CommandPacked); // Setup the antennae to listen for commands fReceiver = new GDIReceivingChannel(GDIPortal.Multicast_Pixtour_Group, GDIPortal.Multicast_Pixtour_Port, fDeviceContext); }
public GDIGeometryRenderer(GDIDeviceContext devContext) { fObjectDictionary = new Dictionary<Guid,IUniqueGDIObject>(); fDeviceContext = devContext; GDI32.SetGraphicsMode(fDeviceContext.Handle, GDI32.GM_ADVANCED); // Use advanced graphics mode so we can use world transforms }