当前位置: 首页>>代码示例>>C++>>正文


C++ CModelDefPtr::GetRenderData方法代码示例

本文整理汇总了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);
}
开发者ID:,项目名称:,代码行数:14,代码来源:

示例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);
    }
}
开发者ID:,项目名称:,代码行数:15,代码来源:

示例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;
}
开发者ID:Marlinc,项目名称:0ad,代码行数:16,代码来源:InstancingModelRenderer.cpp

示例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);
}
开发者ID:Valvador,项目名称:PyroSpaceFork,代码行数:19,代码来源:InstancingModelRenderer.cpp

示例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();
}
开发者ID:Marlinc,项目名称:0ad,代码行数:23,代码来源:InstancingModelRenderer.cpp


注:本文中的CModelDefPtr::GetRenderData方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。