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

Method registerTexture

examples/SharedMemory/RemoteGUIHelper.cpp:413–440  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

411}
412
413int RemoteGUIHelper::registerTexture(const unsigned char* texels, int width, int height)
414{
415 int textureId = -1;
416
417 //first upload all data
418
419 GraphicsSharedMemoryCommand* cmd = m_data->getAvailableSharedMemoryCommand();
420 if (cmd)
421 {
422 int sizeInBytes = width * height * 3; //rgb
423 uploadData(texels, sizeInBytes, 0);
424 cmd->m_updateFlags = 0;
425 cmd->m_type = GFX_CMD_REGISTER_TEXTURE;
426 cmd->m_registerTextureCommand.m_width = width;
427 cmd->m_registerTextureCommand.m_height = height;
428 m_data->submitClientCommand(*cmd);
429 const GraphicsSharedMemoryStatus* status = 0;
430 while ((status = m_data->processServerStatus()) == 0)
431 {
432 }
433 if (status->m_type == GFX_CMD_REGISTER_TEXTURE_COMPLETED)
434 {
435 textureId = status->m_registerTextureStatus.m_textureId;
436 }
437 }
438
439 return textureId;
440}
441
442int RemoteGUIHelper::registerGraphicsShape(const float* vertices, int numvertices, const int* indices, int numIndices, int primitiveType, int textureId)
443{

Callers 15

mainFunction · 0.45
TutorialMethod · 0.45
mainFunction · 0.45
mainFunction · 0.45
processDeformableMethod · 0.45
processCommandMethod · 0.45

Calls 3

submitClientCommandMethod · 0.45
processServerStatusMethod · 0.45

Tested by

no test coverage detected