MCPcopy Create free account
hub / github.com/bulletphysics/bullet3 / uploadData

Method uploadData

examples/SharedMemory/RemoteGUIHelperTCP.cpp:389–428  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

387}
388
389int RemoteGUIHelperTCP::uploadData(const unsigned char* data, int sizeInBytes, int slot)
390{
391 int chunkSize = 1024;// GRAPHICS_SHARED_MEMORY_MAX_STREAM_CHUNK_SIZE;
392 int remainingBytes = sizeInBytes;
393 int offset = 0;
394
395 GraphicsSharedMemoryCommand* cmd = m_data->getAvailableSharedMemoryCommand();
396 cmd->m_updateFlags = 0;
397 cmd->m_type = GFX_CMD_UPLOAD_DATA;
398 cmd->m_uploadDataCommand.m_numBytes = sizeInBytes;
399 cmd->m_uploadDataCommand.m_dataOffset = offset;
400 cmd->m_uploadDataCommand.m_dataSlot = slot;
401 m_data->submitClientCommand(*cmd);
402
403
404
405
406 const GraphicsSharedMemoryStatus* status = 0;
407 while ((status = m_data->processServerStatus()) == 0)
408 {
409 }
410
411 while (remainingBytes > 0)
412 {
413 int curBytes = btMin(remainingBytes, chunkSize);
414 m_data->m_tcpSocket.Send((const uint8*)data+offset, curBytes);
415 if (gVerboseNetworkMessagesClient3)
416 printf("sending %d bytes\n", curBytes);
417 remainingBytes -= curBytes;
418 offset += curBytes;
419 }
420 if (gVerboseNetworkMessagesClient3)
421 printf("send all bytes!\n");
422
423 status = 0;
424 while ((status = m_data->processServerStatus()) == 0)
425 {
426 }
427 return 0;
428}
429
430int RemoteGUIHelperTCP::registerTexture(const unsigned char* texels, int width, int height)
431{

Callers

nothing calls this directly

Calls 4

submitClientCommandMethod · 0.45
processServerStatusMethod · 0.45
SendMethod · 0.45

Tested by

no test coverage detected