本文整理汇总了C++中shared_ptr::Bind方法的典型用法代码示例。如果您正苦于以下问题:C++ shared_ptr::Bind方法的具体用法?C++ shared_ptr::Bind怎么用?C++ shared_ptr::Bind使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类shared_ptr
的用法示例。
在下文中一共展示了shared_ptr::Bind方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Buffer
MdD(const SectionDataEx &sde, int meshId, const vector<DMat> &mtbm) :
triCnt(sde.meshIndex[meshId].size() / 3),
id(new Buffer()),
vt(new Buffer()),
meshVertId(new Buffer()),
meshVertWt(new Buffer())
{
assert(sde.meshIndex[meshId].size() % 3 == 0);
/* Mesh */
id->Bind(oglplus::BufferOps::Target::Array);
Buffer::Data(oglplus::BufferOps::Target::Array, ExIntToGLuint(sde.meshIndex[meshId]));
vt->Bind(oglplus::BufferOps::Target::Array);
Buffer::Data(oglplus::BufferOps::Target::Array, ExFloatToGLfloat(sde.meshVert[meshId]));
/* Bone */
meshVertId->Bind(oglplus::BufferOps::Target::Array);
Buffer::Data(oglplus::BufferOps::Target::Array, ExIntToGLuint(sde.meshVertId[meshId]));
meshVertWt->Bind(oglplus::BufferOps::Target::Array);
Buffer::Data(oglplus::BufferOps::Target::Array, ExFloatToGLfloat(sde.meshVertWt[meshId]));
boneMeshToBoneMatrix = mtbm;
}
示例2: Prime
void Prime(const MdT &mt, const MdD &md, const DMat &meshMat, const vector<DMat> &boneWorldMatrix) {
assert(boneWorldMatrix.size() == md.boneMeshToBoneMatrix.size());
triCnt = md.triCnt;
va->Bind();
/* Mesh */
md.id->Bind(oglplus::BufferOps::Target::ElementArray);
md.vt->Bind(oglplus::BufferOps::Target::Array);
(*prog|"Position").Setup(3, oglplus::DataType::Float).Enable();
/* Bone */
EX_OGLPLUS_ATTRIB_ARRAY_ACTIVE(*prog, "BoneId", md.meshVertId, 4, UnsignedInt);
EX_OGLPLUS_ATTRIB_ARRAY_ACTIVE(*prog, "BoneWt", md.meshVertWt, 4, Float);
/* MdT */
ProgramUniform<Mat4f>(*prog, "ProjectionMatrix") = mt.ProjectionMatrix;
ProgramUniform<Mat4f>(*prog, "CameraMatrix") = mt.CameraMatrix;
ProgramUniform<Mat4f>(*prog, "ModelMatrix") = mt.ModelMatrix;
OptionalProgramUniform<Mat4f>(*prog, "MeshMat") = DMatToOgl(meshMat);
{
vector<oglplus::Mat4f> v;
assert(boneWorldMatrix.size() == md.boneMeshToBoneMatrix.size());
for (int i = 0; i < boneWorldMatrix.size(); i++)
v.push_back(DMatToOgl(DMat::Multiply(boneWorldMatrix[i], md.boneMeshToBoneMatrix[i])));
OptionalProgramUniform<Mat4f>(*prog, "BoneMat").Set(v);
}
Validate();
}