//assumes mesh renderer has already been newed off
void SetDefaultTexturedMeshRenderer(MeshRenderer& meshRenderer){

	meshRenderer.m_material->InitializeMaterial("Data/Shaders/basicSampler.vert", "Data/Shaders/basicSampler.frag");

	meshRenderer.m_mesh->SetDrawMode(GL_QUADS);

	meshRenderer.BindVertexArray();
}
void SetDefaultMeshRenderer(MeshRenderer& meshRenderer){
	//meshRenderer = MeshRenderer();

	//meshRenderer.m_material = new Material();
	meshRenderer.SetDefaultMaterial();

	//meshRenderer.m_mesh = new Mesh();
	meshRenderer.m_mesh->SetDrawMode(GL_QUADS);

	meshRenderer.BindVertexArray();
}
示例#3
0
//assumes only common model file path
MeshRenderer WarlockeryModelLoader::CreateNewMeshRendererFromWarlockeryModelFile(const std::string& fileName){

	MeshRenderer meshRenderer = MeshRenderer();

	meshRenderer.m_mesh = new Mesh();

	meshRenderer.m_mesh->SetDrawMode(GL_TRIANGLES);

	LoadWarlockeryModelFileToMesh(fileName, meshRenderer.m_mesh, true);

	meshRenderer.m_material = new Material();

	std::string modelShaderName = "ModelLighting";

	SetCustomModelMaterial(meshRenderer.m_material, modelShaderName + ".vert", modelShaderName + ".frag");

	LoadModelTexturesForWarlockeryModelFile(meshRenderer.m_material, fileName);
	
	meshRenderer.BindVertexArray();

	return meshRenderer;

}