Add option to mjspec for creating a texture directly from a buffer.

PiperOrigin-RevId: 662186527
Change-Id: I469c876681d52964ac971c0bb2ec3517224d3a3d
This commit is contained in:
Alessio Quaglino
2024-08-12 12:26:39 -07:00
committed by Copybara-Service
parent 20cae556ee
commit 851bb6eef4
16 changed files with 267 additions and 95 deletions
+2 -1
View File
@@ -21,6 +21,7 @@
#include <csetjmp>
#include <cstddef>
#include <cstdint>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <exception>
@@ -2573,7 +2574,7 @@ void mjCModel::CopyObjects(mjModel* m) {
m->tex_adr[i] = data_adr;
// copy rgb data
memcpy(m->tex_data + data_adr, ptex->data.data(),
memcpy(m->tex_data + data_adr, ptex->data_.data(),
ptex->nchannel * ptex->width * ptex->height);
// advance counter