Original Post
Hi, I'm having problem with sending a SDL_Surface through winsock. This works fine.
// Load an image to a surface
SDL_Surface* image = sdl.loadImage("image.png");
// Convert the SDL_Surface* to char*
char* data = (char*)image;
// Convert the char back to SDL_Surface*
SDL_Surface* image2 = (SDL_Surface*)data;
// Draw the image to screen
sdl.drawImage(image2,0,0);
But when I'm trying the send the char* over the network and convert it back to SDL_Surface* it just won't work. :S What am I doing wrong? // ixuz