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


C++ Graphic::SetShader方法代码示例

本文整理汇总了C++中Graphic::SetShader方法的典型用法代码示例。如果您正苦于以下问题:C++ Graphic::SetShader方法的具体用法?C++ Graphic::SetShader怎么用?C++ Graphic::SetShader使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Graphic的用法示例。


在下文中一共展示了Graphic::SetShader方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: Initialize

// |----------------------------------------------------------------------------|
// |							   Initialize									|
// |----------------------------------------------------------------------------|
bool Player::Initialize() {
    GameObject::Initialize();

	// Set up ship
	Graphic* graphic = new Graphic;
    graphic->SetTint(1.0f,1.0f,1.0f,1.0f);
    graphic->SetShader("Texture");
    graphic->SetShader("Light");
	graphic->SetTexture("shiptexture");
    graphic->SetModel("ship");
    graphic->SetScale(Coord(0.01f,0.01f,0.01f));
	graphic->SetReflectiveness(0.95f);
    graphic->Initialize();
    m_ship = new GameObject;
    m_ship->Initialize();
	m_ship->SetGraphic(graphic);
    m_ship->SetPosition(Coord(0.0f,0.0f,0.0f));
    m_ship->SetOrientation(Coord(0.0f,0.0f,0.0f));

    // Set up left thruster
    m_leftThruster = new ParticleSystem;
    m_leftThruster->Initialize();
    graphic = new Billboard;
    graphic->SetShader("Texture");
    graphic->SetTexture("fireball");
    graphic->SetAlphaBlend(true);
    graphic->SetScale(Coord(0.003f,0.003f,0.003f));
    graphic->Initialize();
    m_leftThruster->SetGraphic(graphic);
    m_leftThruster->SetPosition(Coord(-0.6f,0.0f,-0.7f));
    m_leftThruster->SetParticleVelocity(Coord(0.0f,0.0f,-2.0f));
    m_leftThruster->SetParticleVelocityVariation(Coord(0.5f,0.5f,0.5f));
    m_leftThruster->SetParticleSpawnFrequency(0.01f);
    m_leftThruster->SetParticleDeviation(Coord(0.0f,0.0f,0.0f));
    m_leftThruster->SetParticleLifetime(0.5f);
    m_leftThruster->SetParticleFadeout(0.2f);
    m_leftThruster->SetMaxParticles(100);
    m_leftThruster->SetTint(0.8f,0.9f,1.0f);
    m_leftThruster->SetTintVar(0.2f,0.2f,0.2f);

    // Set up right thruster
    m_rightThruster = new ParticleSystem;
    m_rightThruster->Initialize();
    graphic = new Billboard;
    graphic->SetShader("Texture");
    graphic->SetTexture("fireball");
    graphic->SetAlphaBlend(true);
    graphic->SetScale(Coord(0.003f,0.003f,0.003f));
    graphic->Initialize();
    m_rightThruster->SetGraphic(graphic);
    m_rightThruster->SetPosition(Coord(0.6f,0.0f,-0.7f));
    m_rightThruster->SetParticleVelocity(Coord(0.0f,0.0f,-2.0f));
    m_rightThruster->SetParticleVelocityVariation(Coord(0.5f,0.5f,0.5f));
    m_rightThruster->SetParticleSpawnFrequency(0.001f);
    m_rightThruster->SetParticleDeviation(Coord(0.0f,0.0f,0.0f));
    m_rightThruster->SetParticleLifetime(0.5f);
    m_rightThruster->SetParticleFadeout(0.2f);
    m_rightThruster->SetMaxParticles(100);
    m_rightThruster->SetTint(0.8f,0.9f,1.0f);
    m_rightThruster->SetTintVar(0.2f,0.2f,0.2f);



	DebugLog ("Player: object initialized.");
	return true;
}
开发者ID:Jiyambi,项目名称:Solar-Sojourn,代码行数:69,代码来源:Player.cpp


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