Skip to main content
gamedev.net
🔒 Locked

client-server

Started by ta_tee473 0 replies 200+ views
Original Post
ta_tee473
ta_tee473
i have a bitmap and i create a bitmap into surface Ex.... LPDIRECTDRAWSURFACE7 pTest; pTest = GetBmp(directdraw, "test.bmp"); primary->BltFast(10, 10, pTest, NULL, DDBLTFAST_WAIT); i would like to know , can i send pTest[LPDIRECTDRAWSURFACE7] from client to server? how i do? somebody tell me please........ Ex... nsent = send(socket, (char *)& .????. , .????. , 0); thank a lot ........
--------- ta_tee473 ----------
S1CA
S1CA
Something like:

BYTE* buffer = new BYTE[bmpwidth*bmpheight*bmpdepth];
...
pTest->Lock( blah );
copy_all_pixels_from_the_locked_surface_to_"buffer"();
pTest->Unlock();
...
send( blah, (unsigned char*)buffer, blah


however:

1) since it looks like you have a BMP loading function (GetBmp), you probably already have the pixels in their raw form before they get put into the DirectDraw surface.

2) the machine at the other end of the connection might not support the same pixel format for the surfaces (e.g. client graphics card may only support 565 and server may only support 555 so the locked data would be incompatible), so once again sending the raw BMP over the connection would make more sense.




--
Simon O''Connor
Creative Asylum Ltd
www.creative-asylum.com
Simon O'Connor | Technical Director (Newcastle) Lockwood Publishing | LinkedIn | Personal site

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.