1
Graphics / problem with second monitor
« on: September 12, 2007, 03:20:03 pm »
all ours sdl + opengl program working gine with the dual monitor setup
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
if (Who == 's')
{
// Run as a server
if (Protocol == 't')
DoServerTCP(PortA); // was Port
else
DoServerUDP(PortA); // was Port
}
else
{
// Run as a client
if (Protocol == 't')
DoClientTCP(PortB); // was Port
else
DoClientUDP(PortB); // was Port
}
DoClientUDP(PortB, PortA);
...
void SocketUDP::Create()
{
...
mySocket = socket(AF_INET, SOCK_DGRAM, 0);
ret= bind(mySocket , PortB);
...
}
...
bool SocketUDP::Send(const char* Data, std::size_t Size, const IPAddress& Address, unsigned short PortA)
{
...
Target.sin_family = AF_INET;
Target.sin_port = htons(PortA);
Target.sin_addr.s_addr = inet_addr(Address.ToString().c_str());
...
}
PS : you don't need to do so many changes in the code, just pass the last parameter of sfSocketUDP::Receive (the port) by reference so that the function can overwrite it and pass it back to the caller.
IPAddress(const std::string& Address, Uint16 port = 0);
IPAddress(Uint8 Byte0, Uint8 Byte1, Uint8 Byte2, Uint8 Byte3, Uint16 port = 0);
Uint16 getPort() const { return myPort; }
void setPort(Uint16 port) { myPort = port; }
...
private:
Uint16 myPort;
IPAddress::IPAddress(const std::string& Address, Uint16 port) :
myPort(port)
{
...
}
IPAddress::IPAddress(Uint8 Byte0, Uint8 Byte1, Uint8 Byte2, Uint8 Byte3, Uint16 port) :
myPort(port)
{
...
}
Address.setPort(htons(Sender.sin_port));
bool SocketTCP::Connect(unsigned short Port, const IPAddress& HostAddress)
bool SocketTCP::Connect(const IPAddress& HostAddress)
sfAudioDevice::~sfAudioDevice()
{
// Destroy all device-dependant resources
std::for_each(myResources.begin(), myResources.end(), std::mem_fun(&sfAudioResource::DestroyAudioResources));
// Destroy the context
alcMakeContextCurrent(NULL); // access violation reading location 0xXXXXX
if (myContext)
alcDestroyContext(myContext);
// Destroy the device
if (myDevice)
alcCloseDevice(myDevice);
}