There are 3 buffers
std::vector< vec3 > verticies; std::vector< vec2 > tcoords; std::vector< vec3 > normals; When creating the Vertex buffer, filling in the D3D11_SUBRESOURCE_DATA structure specifies the pointer to the array from which the D3D11 buffer will be created
vData.pSysMem = verticies.data(); // сюда нужно послать ещё tcoords и normals The problem is that there are three arrays, and the pointer is needed 1.
I tried type designs
struct Vertex{ Vertex(){} Vertex( vec3* _pos, vec2* _texCoord, vec3* _norm){ pos = _pos; texCoord = _texCoord; norm = _norm; } vec3* pos; vec2* texCoord; vec3* norm; }; std::vector< Vertex > verts; this->verts.push_back( Vertex( verticies.data(), tcoords.data(), normals.data() )); vData.pSysMem = this->verts.data(); somehow unsuccessfully
Maybe there are other ways, for example, using the features of C ++, or Direct3D 11 itself? On OpenGL, individual functions create everything without problems, but there is something else in the D3D11?