| 411 | } |
| 412 | |
| 413 | int 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 | |
| 442 | int RemoteGUIHelper::registerGraphicsShape(const float* vertices, int numvertices, const int* indices, int numIndices, int primitiveType, int textureId) |
| 443 | { |
no test coverage detected