#ifndef RENDER_RESOURCES_H
#define RENDER_RESOURCES_H
#include <wrl/client.h>
#include <d3d11.h>
#include <DirectXMath.h>
#include <vector>
#include <render_type_def.h>



struct SharedMesh { //=
    SharedMesh(int index, const Z::Mesh *mesh, ID3D11Device *device);
    ~SharedMesh();
    int modelIdx; //在 Z::Model.ar_meshDatas 数组内的下标
    std::string name;
    DirectX::XMFLOAT4X4 localTsf;
    bool hasSkin{};
    unsigned int countIndices;
    Microsoft::WRL::ComPtr<ID3D11Buffer> buf_vert;
    Microsoft::WRL::ComPtr<ID3D11Buffer> buf_index;
};

struct SharedModel { //=
public: // static
    static SharedModel *S_AddSharedModel(Z::Model *model, ID3D11Device *device);

public: //instance
    int globalIndex; //scene保存的全局已加载的SharedModel的index
    std::string name;
    std::vector<SharedMesh> ar_sharedMesh;

};



















#endif //RENDER_RESOURCES_H
