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


C++ Window::IsOpened方法代码示例

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


在下文中一共展示了Window::IsOpened方法的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;
}
开发者ID:sylvon,项目名称:AMazing,代码行数:8,代码来源:Main.cpp

示例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();
  }
}
开发者ID:emint,项目名称:scratch,代码行数:11,代码来源:main.cpp

示例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;
}
开发者ID:tatianai,项目名称:Movie-Maker,代码行数:12,代码来源:main.cpp

示例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;
}
开发者ID:mwlow,项目名称:flying,代码行数:14,代码来源:main.cpp

示例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;
}
开发者ID:mrotondo,项目名称:ccrma,代码行数:14,代码来源:Main.cpp

示例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;
}
开发者ID:,项目名称:,代码行数:23,代码来源:

示例7: main

int main ( int argc, char **argv )
{
	// On cr�e notre fen�tre gr�ce � SFML
	Application.Create( sf::VideoMode( 800, 500, 32 ), "SFML : Bullet physics", sf::Style::Titlebar | sf::Style::Resize | sf::Style::Close);
    //Application.Create(sf::VideoMode::GetMode(0), "SFML Window", sf::Style::Fullscreen);
	// Creation d'une fen�tre plein �cran avec le meilleur mode vid�o
  	
    
    
    /// Bullet physics
	
    ///collision configuration contains default setup for memory, collision setup
	myCollisionConfiguration = new btDefaultCollisionConfiguration();
	
	///use the default collision dispatcher. For parallel processing you can use a diffent dispatcher (see Extras/BulletMultiThreaded)
	myDispatcher = new	btCollisionDispatcher(myCollisionConfiguration);
	
	myBroadphase = new btDbvtBroadphase();
	
	///the default constraint solver. For parallel processing you can use a different solver (see Extras/BulletMultiThreaded)
	mySequentialImpulseConstraintSolver = new btSequentialImpulseConstraintSolver;
	
	// initialisation du monde bullet
	myWorld = new btDiscreteDynamicsWorld(myDispatcher,myBroadphase,mySequentialImpulseConstraintSolver,myCollisionConfiguration);
	
	// On d�finit la gravit�, de fa�on � ce que les objets tombent vers le bas (-Y).
	myWorld->setGravity( btVector3(0,-10,0) );
	
	/// SOL ///////////////////////////////////////////
	// create a shape
	btCollisionShape* shape_sol = new btBoxShape( btVector3(100,1,100) );
	
	myTransform.setIdentity();
	myTransform.setOrigin( btVector3(0,0,0) );
	
	btVector3 localInertiaSol(0,0,0);
	
	btScalar mass = 0;
	
	// Using motionstate is recommended, it provides interpolation capabilities, and only synchronizes 'active' objects
	myMotionState_Sol = new btDefaultMotionState(myTransform);
	btRigidBody::btRigidBodyConstructionInfo rbInfo_sol( mass, myMotionState_Sol, shape_sol, localInertiaSol );
	body_sol = new btRigidBody(rbInfo_sol);
	
	// Add the body to the dynamics world
	myWorld->addRigidBody(body_sol);

 
    
    
    
    // Create a clock for measuring time elapsed
    sf::Clock montre;
    //Variable pour calculer le delta de d�placement de la souris quand les clicks droit et gauche de la souris sont enfonc� pour manipuler la cam�ra
  
    // Pour d�clancher la chute d'un seul kapla quand la touche Espace est relach�e
	bool trigger = false; 
 
	unsigned int windowsWidth = Application.GetWidth();
    unsigned int windowsHeight = Application.GetHeight();
    
    
    int startPointX(0),startPointY(0);
    float deltaX(0),deltaY(0),prevDeltaX(1),prevDeltaY(1);
    int   MouseX(0);
    int   MouseY(0);
    bool show = true;
    
	//unsigned int sizeWidth = sf::Window::GetWidth();
    
    //On initialise une cam�ra qui sera plac� par d�faut par le constructeur
    Camera camcam(110,60.0,60.0);
    Cursor cursor;
bool test = false;
       
    float time;

 // pour avoir les infos clavier en temps r�el
	const sf::Input& Input = Application.GetInput();
	// Notre boucle d'affichage
	while(Application.IsOpened() )
	{
        Application.ShowMouseCursor (false);
        // r�f�rence vers l'entr�e associ�e � une fen�tre (pour r�cup�rer les donn�s clavier en temps r�el
        
        sf::Event Event;
        //Utilise les fl�che pour d�placer le Kapla qui va �tre lach�
        // Get some useless input states, just to illustrate the tutorial
        bool         LeftKeyDown     = Input.IsKeyDown(sf::Key::Left);
        bool         RightKeyDown     = Input.IsKeyDown(sf::Key::Right);
        bool         UpKeyDown     = Input.IsKeyDown(sf::Key::Up);
        bool         DownKeyDown     = Input.IsKeyDown(sf::Key::Down);
        
        bool         RightButtonDown = Input.IsMouseButtonDown(sf::Mouse::Right);
        bool         LeftButtonDown = Input.IsMouseButtonDown(sf::Mouse::Left);
        bool         Espace     = Input.IsKeyDown(sf::Key::Space);
        bool         Shift     = Input.IsKeyDown(sf::Key::LShift);
        MouseX  =   Input.GetMouseX() ;
        MouseY  =   Input.GetMouseY() ;
        
//.........这里部分代码省略.........
开发者ID:at0mb0y,项目名称:Kapla_graphic_part,代码行数:101,代码来源:main.cpp


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