#19197 Create basic visual studio

This commit is contained in:
vincent 2013-03-28 18:32:52 +01:00
parent 83abc571f1
commit 1c1b7369ae
5 changed files with 20 additions and 21 deletions

View file

@ -166,7 +166,7 @@ double elapsedTime;
// Particles // Particles
char texture_filename[] = "resources/images/int-texture256-v4.png"; char texture_filename[] = "images/int-texture256-v4.png";
unsigned int texture_width = 256; unsigned int texture_width = 256;
unsigned int texture_height = 256; unsigned int texture_height = 256;
@ -562,7 +562,7 @@ void display(void)
char val[20]; char val[20];
sprintf(val, "%d,%d", target_x, target_y); sprintf(val, "%d,%d", target_x, target_y);
drawtext(target_x, target_y-20, 0.08, 0, 1.0, 0, val, 0, 1, 0); drawtext(target_x, target_y-20, 0.08, 0, 1.0, 0, val, 0, 1, 0);
glPointSize(1.0f); glPointSize(1.0f);
} }
if (display_head_mouse && !display_head && stats_on) if (display_head_mouse && !display_head && stats_on)
{ {
@ -572,7 +572,7 @@ void display(void)
glBegin(GL_POINTS); glBegin(GL_POINTS);
glVertex2f(head_mouse_x, head_mouse_y); glVertex2f(head_mouse_x, head_mouse_y);
glEnd(); glEnd();
glPointSize(1.0f); glPointSize(1.0f);
} }
// Spot bouncing back and forth on bottom of screen // Spot bouncing back and forth on bottom of screen
if (0) if (0)

View file

@ -298,13 +298,13 @@ void AgentList::stopSilentAgentRemovalThread() {
#ifdef _WIN32 #ifdef _WIN32
void usleep(int waitTime){ void usleep(int waitTime){
__int64 time1 = 0, time2 = 0, sysFreq = 0; __int64 time1 = 0, time2 = 0, sysFreq = 0;
QueryPerformanceCounter((LARGE_INTEGER *)&time1); QueryPerformanceCounter((LARGE_INTEGER *)&time1);
QueryPerformanceFrequency((LARGE_INTEGER *)&sysFreq); QueryPerformanceFrequency((LARGE_INTEGER *)&sysFreq);
do{ do{
QueryPerformanceCounter((LARGE_INTEGER *)&time2); QueryPerformanceCounter((LARGE_INTEGER *)&time2);
}while( (time2-time1) <waitTime); }while( (time2-time1) <waitTime);
} }
#endif #endif
@ -345,7 +345,6 @@ void *checkInWithDomainServer(void *args) {
if (usecToSleep > 0) { if (usecToSleep > 0) {
usleep(usecToSleep); usleep(usecToSleep);
} }
} }
pthread_exit(0); pthread_exit(0);

View file

@ -85,21 +85,21 @@ int getLocalAddress() {
freeifaddrs(ifAddrStruct); freeifaddrs(ifAddrStruct);
#else #else
// Get the local hostname // Get the local hostname
char szHostName[255]; char szHostName[255];
gethostname(szHostName, 255); gethostname(szHostName, 255);
struct hostent *host_entry; struct hostent *host_entry;
host_entry=gethostbyname(szHostName); host_entry=gethostbyname(szHostName);
char * szLocalIP; char * szLocalIP;
szLocalIP = inet_ntoa (*(struct in_addr *)*host_entry->h_addr_list); szLocalIP = inet_ntoa (*(struct in_addr *)*host_entry->h_addr_list);
localAddress = inet_addr(szLocalIP); localAddress = inet_addr(szLocalIP);
#endif #endif
return localAddress; return localAddress;
} }
UDPSocket::UDPSocket(int listeningPort) { UDPSocket::UDPSocket(int listeningPort) {
init(); init();
// create the socket // create the socket
handle = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP); handle = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);

View file

@ -24,7 +24,7 @@ class UDPSocket {
public: public:
UDPSocket(int listening_port); UDPSocket(int listening_port);
~UDPSocket(); ~UDPSocket();
bool init(); bool init();
int send(sockaddr *destAddress, const void *data, size_t byteLength); int send(sockaddr *destAddress, const void *data, size_t byteLength);
int send(char *destAddress, int destPort, const void *data, size_t byteLength); int send(char *destAddress, int destPort, const void *data, size_t byteLength);
bool receive(void *receivedData, ssize_t *receivedBytes); bool receive(void *receivedData, ssize_t *receivedBytes);