本文整理汇总了C++中CCamera::CopyStateReflect方法的典型用法代码示例。如果您正苦于以下问题:C++ CCamera::CopyStateReflect方法的具体用法?C++ CCamera::CopyStateReflect怎么用?C++ CCamera::CopyStateReflect使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CCamera
的用法示例。
在下文中一共展示了CCamera::CopyStateReflect方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: UpdateWater
void CAdvWater::UpdateWater(CGame* game)
{
if (!waterRendering->forceRendering && !readMap->HasVisibleWater())
return;
glPushAttrib(GL_FOG_BIT | GL_COLOR_BUFFER_BIT);
glEnable(GL_TEXTURE_2D);
glEnable(GL_BLEND);
glBlendFunc(GL_ONE, GL_ONE);
{
bumpFBO.Bind();
glViewport(0, 0, 128, 128);
glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
glClear(GL_COLOR_BUFFER_BIT);
glSpringMatrix2dSetupPV(0.0f, 1.0f, 0.0f, 1.0f, -1.0f, 1.0f);
glColor3f(0.2f, 0.2f, 0.2f);
CVertexArray* va = GetVertexArray();
va->Initialize();
va->EnlargeArrays(12, 0, VA_SIZE_T);
glBindTexture(GL_TEXTURE_2D, rawBumpTexture[0]);
va->AddVertexQT(ZeroVector, 0, 0 + gs->frameNum*0.0046f);
va->AddVertexQT( UpVector, 0, 2 + gs->frameNum*0.0046f);
va->AddVertexQT( XYVector, 2, 2 + gs->frameNum*0.0046f);
va->AddVertexQT( RgtVector, 2, 0 + gs->frameNum*0.0046f);
va->AddVertexQT(ZeroVector, 0, 0 + gs->frameNum*0.0026f);
va->AddVertexQT( UpVector, 0, 4 + gs->frameNum*0.0026f);
va->AddVertexQT( XYVector, 2, 4 + gs->frameNum*0.0026f);
va->AddVertexQT( RgtVector, 2, 0 + gs->frameNum*0.0026f);
va->AddVertexQT(ZeroVector, 0, 0 + gs->frameNum*0.0012f);
va->AddVertexQT( UpVector, 0, 8 + gs->frameNum*0.0012f);
va->AddVertexQT( XYVector, 2, 8 + gs->frameNum*0.0012f);
va->AddVertexQT( RgtVector, 2, 0 + gs->frameNum*0.0012f);
va->DrawArrayT(GL_QUADS);
va = GetVertexArray();
va->Initialize();
glBindTexture(GL_TEXTURE_2D, rawBumpTexture[1]);
va->AddVertexQT(ZeroVector, 0, 0 + gs->frameNum*0.0036f);
va->AddVertexQT( UpVector, 0, 1 + gs->frameNum*0.0036f);
va->AddVertexQT( XYVector, 1, 1 + gs->frameNum*0.0036f);
va->AddVertexQT( RgtVector, 1, 0 + gs->frameNum*0.0036f);
va->DrawArrayT(GL_QUADS);
va = GetVertexArray();
va->Initialize();
glBindTexture(GL_TEXTURE_2D, rawBumpTexture[2]);
va->AddVertexQT(ZeroVector, 0, 0 + gs->frameNum*0.0082f);
va->AddVertexQT( UpVector, 0, 1 + gs->frameNum*0.0082f);
va->AddVertexQT( XYVector, 1, 1 + gs->frameNum*0.0082f);
va->AddVertexQT( RgtVector, 1, 0 + gs->frameNum*0.0082f);
va->DrawArrayT(GL_QUADS);
// this fixes a memory leak on ATI cards
glBindTexture(GL_TEXTURE_2D, 0);
glColor3f(1.0f, 1.0f, 1.0f);
}
reflectFBO.Bind();
glClearColor(sky->fogColor[0], sky->fogColor[1], sky->fogColor[2], 1.0f);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
const double clipPlaneEqs[2 * 4] = {
0.0, 1.0, 0.0, 0.0,
0.0, 1.0, 0.0, 0.0,
};
CCamera* prvCam = CCamera::GetSetActiveCamera(CCamera::CAMTYPE_UWREFL);
CCamera* curCam = CCamera::GetActiveCamera();
{
curCam->CopyStateReflect(prvCam);
curCam->UpdateLoadViewPort(0, 0, 512, 512);
DrawReflections(&clipPlaneEqs[0], true, true);
}
CCamera::SetActiveCamera(prvCam->GetCamType());
prvCam->Update();
prvCam->LoadViewPort();
FBO::Unbind();
glPopAttrib();
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
}