本文整理汇总了C++中CModelDefPtr::GetRenderData方法的典型用法代码示例。如果您正苦于以下问题:C++ CModelDefPtr::GetRenderData方法的具体用法?C++ CModelDefPtr::GetRenderData怎么用?C++ CModelDefPtr::GetRenderData使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CModelDefPtr
的用法示例。
在下文中一共展示了CModelDefPtr::GetRenderData方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CreateModelData
// Create per-CModel data for the model (and per-CModelDef data if necessary)
void* PolygonSortModelRenderer::CreateModelData(CModel* model)
{
CModelDefPtr mdef = model->GetModelDef();
PSModelDef* psmdef = (PSModelDef*)mdef->GetRenderData(m);
if (!psmdef)
{
psmdef = new PSModelDef(mdef);
mdef->SetRenderData(m, psmdef);
}
return new PSModel(model);
}
示例2: PrepareModelDef
// Prepare for rendering models using this CModelDef
void PolygonSortModelRenderer::PrepareModelDef(int streamflags, const CModelDefPtr& def)
{
if (streamflags & STREAM_UV0)
{
PSModelDef* psmdef = (PSModelDef*)def->GetRenderData(m);
ENSURE(psmdef);
u8* base = psmdef->m_Array.Bind();
GLsizei stride = (GLsizei)psmdef->m_Array.GetStride();
glTexCoordPointer(2, GL_FLOAT, stride, base + psmdef->m_UV.offset);
}
}
示例3: CreateModelData
// Build modeldef data if necessary - we have no per-CModel data
void* InstancingModelRenderer::CreateModelData(CModel* model)
{
CModelDefPtr mdef = model->GetModelDef();
IModelDef* imodeldef = (IModelDef*)mdef->GetRenderData(m);
ENSURE(!model->IsSkinned());
if (!imodeldef)
{
imodeldef = new IModelDef(mdef);
mdef->SetRenderData(m, imodeldef);
}
return NULL;
}
示例4: CreateModelData
// Build modeldef data if necessary - we have no per-CModel data
CModelRData* InstancingModelRenderer::CreateModelData(const void* key, CModel* model)
{
CModelDefPtr mdef = model->GetModelDef();
IModelDef* imodeldef = (IModelDef*)mdef->GetRenderData(m);
if (m->gpuSkinning)
ENSURE(model->IsSkinned());
else
ENSURE(!model->IsSkinned());
if (!imodeldef)
{
imodeldef = new IModelDef(mdef, m->gpuSkinning, m->calculateTangents);
mdef->SetRenderData(m, imodeldef);
}
return new CModelRData(key);
}
示例5: PrepareModelDef
// Prepare UV coordinates for this modeldef
void InstancingModelRenderer::PrepareModelDef(CShaderProgramPtr& shader, int streamflags, const CModelDefPtr& def)
{
m->imodeldef = (IModelDef*)def->GetRenderData(m);
ENSURE(m->imodeldef);
u8* base = m->imodeldef->m_Array.Bind();
GLsizei stride = (GLsizei)m->imodeldef->m_Array.GetStride();
m->imodeldefIndexBase = m->imodeldef->m_IndexArray.Bind();
if (streamflags & STREAM_POS)
shader->VertexPointer(3, GL_FLOAT, stride, base + m->imodeldef->m_Position.offset);
if (streamflags & STREAM_NORMAL)
shader->NormalPointer(GL_FLOAT, stride, base + m->imodeldef->m_Normal.offset);
if (streamflags & STREAM_UV0)
shader->TexCoordPointer(GL_TEXTURE0, 2, GL_FLOAT, stride, base + m->imodeldef->m_UV.offset);
shader->AssertPointersBound();
}