Jump to content
  • Advertisement
Sign in to follow this  

Winsock in DirectX, need help!

This topic is 4823 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello everyone, I am a newbei in DirectX. I use QNX to do calculation, and then transmit the calculated data to windows so that a graphic is dislayed with DirectX. I have the following code, but it doesn't work: INT WINAPI WinMain(HINSTANCE hInst, HINSTANCE, LPSTR, INT ) { wVersionRequested = MAKEWORD(2,0); WSAStartup(wVersionRequested, &wsaData); // bzero(&address, 0, sizeof(address)); socket_descriptor=socket(AF_INET, SOCK_DGRAM,IPPROTO_UDP); memset(&address, 0, sizeof(address)); address.sin_family = AF_INET; address.sin_addr.s_addr=htonl(INADDR_ANY); address.sin_port=htons(port); length=sizeof(address); bind(socket_descriptor, (struct sockaddr *)&address, sizeof(address)); whicle(1) { recvfrom(socket_descriptor, (char *)q, sizeof(q), 0, (struct sockaddr *)&fromaddr, &fromlength); // display graphic } } What I want to do is receive data and then display graphic. The winsock code works well in a regular C++ program, but it doesn't work in DirectX code above. How is winsock OR network used in DirectX? What's wrong here? Any answer is welcome. Thanks.

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!