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


C++ config::getWindowHeight方法代码示例

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


在下文中一共展示了config::getWindowHeight方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: reshape

void reshape(int n_w, int n_h)
{
    simConfig.setWindow( n_h, n_w );
    //Change the viewport to be correct
    glViewport( 0, 0, simConfig.getWindowWidth(), simConfig.getWindowHeight());

}
开发者ID:afalconi,项目名称:Graphics,代码行数:7,代码来源:main.cpp

示例2: main

//--Main
int main(int argc, char **argv)
{
    //set config data
    simConfig.setWindow(800, 1280);

    // Initialize glut
    glutInit(&argc, argv);
    glutInitDisplayMode(GLUT_DOUBLE | GLUT_DEPTH);
    glutInitWindowSize( simConfig.getWindowWidth(), simConfig.getWindowHeight());
    glutInitWindowPosition( 100, 100);
    // Name and create the Window
    glutCreateWindow("Air Hockey");
    glutFullScreen();

    // Now that the window is created the GL context is fully set up
    // Because of that we can now initialize GLEW to prepare work with shaders
    GLenum status = glewInit();
    if( status != GLEW_OK)
    {
        std::cerr << "[F] GLEW NOT INITIALIZED: ";
        std::cerr << glewGetErrorString(status) << std::endl;
        return -1;
    }

    // Set all of the callbacks to GLUT that we need
    //glutSetKeyRepeat(GLUT_KEY_REPEAT_OFF); //disable key spamming for now
    glutDisplayFunc(render);// Called when its time to display
    glutReshapeFunc(reshape);// Called if the window is resized
    glutIdleFunc(update);// Called if there is nothing else to do
    glutMouseFunc(mouse);// Called if there is mouse input
    glutMotionFunc(mouseChange);
    glutPassiveMotionFunc(mouseChange);
    glutKeyboardFunc(keyPressed);// Called if there is keyboard input
    glutKeyboardUpFunc(keyUp);// Called if there is keyboard anti-input
    glutSpecialFunc(keyboardPlus);// for stuff without ascii access characters like arrow keys

    //setup inputs
    menuID = glutCreateMenu(menu_test);
    glutAddMenuEntry("Resume", 4);
    glutAddMenuEntry("Pause", 3);
    glutAddMenuEntry("Restart", 2);
    glutAddMenuEntry("Quit", 1);
    glutAttachMenu(GLUT_RIGHT_BUTTON);

    //misc setup
    simEntities.simConfig = &simConfig;

    // Initialize all of our resources(config, geometry)
    bool init = initialize();

    //load model data
    #ifdef TESTING
    simEntities.loadData("../bin/data/test_load_list.dat"); // don't want to load all those machines if I'm just testing
    #else
    simEntities.loadData("../bin/data/load_list.dat");
    #endif

    //run our shader loader now
    init = init && simShaderManager.loadShaders(argc,argv);

    //call some other resources to initialize after the shader, separately
    init = init && postInitialize();

    if(init)
    {
        t1 = std::chrono::high_resolution_clock::now();
        glutMainLoop();
    }

    // Clean up after ourselves
    cleanUp();
    return 0;
}
开发者ID:afalconi,项目名称:Graphics,代码行数:74,代码来源:main.cpp


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