本文整理汇总了C++中CTexture::Init方法的典型用法代码示例。如果您正苦于以下问题:C++ CTexture::Init方法的具体用法?C++ CTexture::Init怎么用?C++ CTexture::Init使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CTexture
的用法示例。
在下文中一共展示了CTexture::Init方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Swap
void CTexture::Swap( CTexture &tsrc )
{
CTexture temp;
temp.Copy( *this );
Copy( tsrc );
tsrc.Copy( temp );
temp.Init();
}
示例2: Start
virtual bool Start()
{
CInputTask::GetPtr()->AddInputEventListener(this);
CCameraTask::GetPtr()->SetPosition(CVector(5, 5, 20));
m_nPolygonMode = GL_FILL;
CPixelBuffer pb;
pb.Init(64, 1, 1, 2, GL_LUMINANCE_ALPHA);
pb.MakeGlow1D();
m_tex.Init(&pb);
return true;
}
示例3: Start
virtual bool Start()
{
CInputTask::GetPtr()->AddInputEventListener(this);
CCameraTask::GetPtr()->SetPosition(CVector(0, 0, 25));
CCameraTask::GetPtr()->SetThrust(1.0f);
m_nPolygonMode = GL_FILL;
m_vLight = CVector(1000, 1000, 1000);
m_vLightDirection = m_vLight / m_vLight.Magnitude();
m_nSamples = 2; // Number of sample rays to use in integral equation
m_Kr = 0.0025f; // Rayleigh scattering constant
m_Kr4PI = m_Kr*4.0f*PI;
m_Km = 0.0015f; // Mie scattering constant
m_Km4PI = m_Km*4.0f*PI;
m_ESun = 15.0f; // Sun brightness constant
m_g = -0.95f; // The Mie phase asymmetry factor
m_fInnerRadius = 10.0f;
m_fOuterRadius = 10.25f;
m_fScale = 1 / (m_fOuterRadius - m_fInnerRadius);
m_fWavelength[0] = 0.650f; // 650 nm for red
m_fWavelength[1] = 0.570f; // 570 nm for green
m_fWavelength[2] = 0.475f; // 475 nm for blue
m_fWavelength4[0] = powf(m_fWavelength[0], 4.0f);
m_fWavelength4[1] = powf(m_fWavelength[1], 4.0f);
m_fWavelength4[2] = powf(m_fWavelength[2], 4.0f);
m_fRayleighScaleDepth = 0.25f;
m_fMieScaleDepth = 0.1f;
m_pbOpticalDepth.MakeOpticalDepthBuffer(m_fInnerRadius, m_fOuterRadius, m_fRayleighScaleDepth, m_fMieScaleDepth);
m_tOpticalDepth.Init(&m_pbOpticalDepth);
m_shSkyFromSpace.Init("shaders/SkyFromSpaceVert.glsl", "shaders/SkyFromSpaceFrag.glsl");
m_shSkyFromAtmosphere.Init("shaders/SkyFromAtmosphereVert.glsl", "shaders/SkyFromAtmosphereFrag.glsl");
m_shGroundFromSpace.Init("shaders/GroundFromSpaceVert.glsl", "shaders/GroundFromSpaceFrag.glsl");
m_shGroundFromAtmosphere.Init("shaders/GroundFromAtmosphereVert.glsl", "shaders/GroundFromAtmosphereFrag.glsl");
m_fExposure = 2.0f;
m_fb.Init(800, 600, GL_RGBA16F_ARB);
//m_fb.Init(800, 600, GL_RGBA8);
m_shHDR.Init("shaders/HDRVert.glsl", "shaders/HDRFrag.glsl");
m_bHDR = true;
return true;
}
示例4: Start
virtual bool Start()
{
CInputTask::GetPtr()->AddInputEventListener(this);
CCameraTask::GetPtr()->SetPosition(CVector(0, 0, 2));
m_nPolygonMode = GL_FILL;
m_cSphere.SetPosition(CVector(-15, 0, -50));
m_cSphere.SetBoundingRadius(15.0f);
m_cSphere2.SetPosition(CVector(10, 0, -50));
m_cSphere2.SetBoundingRadius(20.0f);
CPixelBuffer pb;
pb.Init(128, 128, 128, 2, GL_LUMINANCE_ALPHA);
pb.Make3DNoise(238653);
m_tex.Init(&pb, false, false);
m_shader.Init("shaders\\SwellVert.glsl", "shaders\\SwellFrag.glsl");
return true;
}
示例5: Transfer
void CTexture::Transfer( CTexture &tsrc )
{
Copy( tsrc);
tsrc.Init();
}