本文整理汇总了C++中sf::Window::Display方法的典型用法代码示例。如果您正苦于以下问题:C++ Window::Display方法的具体用法?C++ Window::Display怎么用?C++ Window::Display使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sf::Window
的用法示例。
在下文中一共展示了Window::Display方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, char** argv) {
// Put your game loop here (i.e., render with OpenGL, update animation)
while (window.IsOpened()) {
window.Display();
}
return 0;
}
示例2: main
int main() {
Renderable3DS object("models/cat-braizer.3ds");
object.printInfo();
while (window.IsOpened()) {
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
handleInput();
createView();
object.render();
window.Display();
}
}
示例3: main
int main(int argc, const char * argv[]) {
initGL();
loadShader();
_scene.initialize("current_mesh_texture.ply");
InputHandler inputHandler(_window, _window.GetInput(), &_camera);
while (_window.IsOpened()) {
inputHandler.handleInput();
renderFrame();
_window.Display();
}
return 0;
}
示例4: main
int main(int argc, const char **argv)
{
init(argc, argv);
loadAssets();
while (window.IsOpened()) {
clockdiff = clck.GetElapsedTime();
elapsed += clockdiff;
clck.Reset();
inputFn();
renderFn();
window.Display();
}
return 0;
}
示例5: main
int main(int argc, char** argv) {
initOpenGL();
loadAssets();
// Put your game loop here (i.e., render with OpenGL, update animation)
while (window.IsOpened()) {
handleInput();
renderFrame();
window.Display();
}
return 0;
}
示例6: main
int main(int argc, char** argv) {
initOpenGL();
loadAssets();
// go to a square Viewport
glViewport(0, 0, CUBE_MAP_SIZE, CUBE_MAP_SIZE);
generateEnvironmentMap();
// go to our window Viewport
glViewport(0, 0, window.GetWidth(), window.GetHeight());
// Put your game loop here (i.e., render with OpenGL, update animation)
while (window.IsOpened()) {
handleInput();
renderFrame();
window.Display();
updatePositions();
}
return 0;
}
示例7: 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();
}
}