本文整理汇总了C++中sf::Window::SetActive方法的典型用法代码示例。如果您正苦于以下问题:C++ Window::SetActive方法的具体用法?C++ Window::SetActive怎么用?C++ Window::SetActive使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sf::Window
的用法示例。
在下文中一共展示了Window::SetActive方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
//.........这里部分代码省略.........
//cout << delta<< endl;
while (Application.GetEvent(Event))
{
if (Event.Type == sf::Event::Resized)
glViewport(0, 0, Event.Size.Width, Event.Size.Height);
// Fen�tre ferm�e
if (Event.Type == sf::Event::Closed)
Application.Close();
// Touche 'echap' appuy�e
if ((Event.Type == sf::Event::KeyPressed) && (Event.Key.Code == sf::Key::Escape))
Application.Close();
if ((Event.Type == sf::Event::KeyReleased) && (Event.Key.Code == sf::Key::Space)) {
/// box ///////////////////////////////////////////
// create a shape
btCollisionShape* shape_kapla = new btBoxShape( btVector3(3,1,15) );
myTransform.setIdentity();
int dropX((MouseX - windowsWidth/2));
int dropY((MouseY - windowsHeight/2));
myTransform.setOrigin(btVector3(dropX,5,dropY));
btVector3 localInertia(0,0,0);
mass = 0.5f;
shape_kapla->calculateLocalInertia( mass, localInertia );
//using motionstate is recommended, it provides interpolation capabilities, and only synchronizes 'active' objects
myMotionState = new btDefaultMotionState(myTransform);
btRigidBody::btRigidBodyConstructionInfo myBoxRigidBodyConstructionInfo( mass,myMotionState, shape_kapla, localInertia );
body_kapla = new btRigidBody(myBoxRigidBodyConstructionInfo);
//add the body to the dynamics world
myWorld->addRigidBody(body_kapla);
trigger=true;
}
}
Application.SetActive();
//NEED convertiseur coord souris -> coord du plan visible par la cam�ra
// le d�placement sur le plan de la fen�tre est proportionel � celui du plan de construction
// dessin le curseur
//cursor.drawKapla(1,15,3);
//touche espace enfonc�e et relach�e
if ((Espace))
{
}
if (myWorld)
{
myWorld->stepSimulation( 0.0001 );
}
camcam.display();
cursor.drawKapla(15, 3, 1);
// On recup�re la matrice OpenGL transform�e par Bullet qu'on appliquera � notre boite
if (trigger)
{
myMotionState->m_graphicsWorldTrans.getOpenGLMatrix( matrix );
glPushMatrix();
glMultMatrixf( matrix );
box(3,1,15);
glPopMatrix();
}
box(100,1,100);
// On a ffiche le sol;
if (test==true)
{
}
// swap buffers, etc
Application.Display();
}
}