int main(int argc, char** argv) { glutInit(&argc, argv); glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH); Width = 640; Height = 480; glutInitWindowSize(Width, Height); glutCreateWindow("2D Sprites Example"); initRendering(); engine.Initialize(); glutDisplayFunc(drawScene); glutKeyboardFunc(handleKeypress); glutSpecialFunc(KeyboardSpecial); glutSpecialUpFunc(KeyboardUpSpecial); glutReshapeFunc(handleResize); glutIdleFunc(onIdle); glutMainLoop(); engine.Finalize(); return 0; }
int main(int argc, char *argv[]) { CW = (MIN(w,h)-2*BORDER)/COLS; CH = CW; xoffset = (w-(CW*COLS))/2; stepDelay = DELAY; initgrid(); glutInit(&argc, argv); glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH); glutInitWindowSize(w, h); glutCreateWindow("SOR Grid"); initRendering(); glutDisplayFunc(drawScene); glutKeyboardFunc(handleKeyPress); glutReshapeFunc(handleResize); glutTimerFunc(stepDelay, update, 0); glutMainLoop(); return 0; }
// Main routine. // Set up OpenGL, define the callbacks and start the main loop int main( int argc, char** argv ) { glutInit(&argc,argv); // We're going to animate it, so double buffer glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH ); // Initial parameters for window position and size glutInitWindowPosition( 60, 60 ); glutInitWindowSize( 360, 360 ); glutCreateWindow("Assignment 2"); // Initialize OpenGL parameters. initRendering(); // Set up callback functions for key presses glutKeyboardFunc(keyboardFunc); // Handles "normal" ascii symbols glutSpecialFunc(specialFunc); // Handles "special" keyboard keys // Set up the callback function for resizing windows glutReshapeFunc( reshapeFunc ); // Call this whenever window needs redrawing glutDisplayFunc( drawScene ); glutMouseFunc(glutMouse); glutMotionFunc (glutMotion); // Start the main loop. glutMainLoop never returns. glutMainLoop( ); return 0; }
int main(int argc ,char **argv) { glutInit(&argc,argv); glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH ); screen_width = glutGet(GLUT_SCREEN_WIDTH); screen_height = glutGet(GLUT_SCREEN_HEIGHT); glutInitWindowPosition(0,0); glutInitWindowSize(screen_width,screen_height); glutCreateWindow("Graphics.... :)"); initRendering(); world.gen_missing(); world.gen_moving(); world.gen_coins(); load_textures(); glutDisplayFunc(draw_scene); glutReshapeFunc(reshape_window); glutKeyboardFunc(handle_keyboard_keys); glutSpecialFunc(handle_special_keyboard_keys); glutSpecialUpFunc(release_keyboard_keys); glutMouseFunc(click_action); glutMotionFunc(click_hold_action); //glutPassiveMotionFunc(mouse_action); glutTimerFunc(60,update_world,0); glutTimerFunc(10,robot_move_forward,0); glutMainLoop(); return 0; }
int NMS_SceneRenderer::run() { initRendering(); initShaders(); renderingLoop(); return 0; }
int main(int argc, char** argv) { //Initialize GLUT glutInit(&argc, argv); glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH); glutInitWindowSize(1200, 700); //Create the window glutCreateWindow("table bookshelf with books"); initRendering(); //Set handler functions glutDisplayFunc(drawScene); glutReshapeFunc(handleResize); //adding here the setting of keyboard processing glutSpecialFunc(processSpecialKeys); update(0); glutMainLoop(); return 0; }
int main(int argc, char* argv[]) { glutInit(&argc, argv); glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB | GLUT_DEPTH); glutInitWindowPosition(300, 300); glutInitWindowSize(400, 400); glutCreateWindow("GG!"); o = 0; //scanf("Enter choice: %d\n", &o); initRendering(); glutKeyboardFunc(keyboardToggler); //glutReshapeFunc(resizeWindow); glutDisplayFunc(drawScene); glutMainLoop(); //glutPostRedisplay(); return 0; }
void processNormalKeys(unsigned char key, int xx, int yy) { if (key == 27) exit(0); switch (key) { case 'w': y = y + 1.0f; break; case 's': y = y - 1.0f; break; case 'r': y = 0.0f; x = 0.0f; z = 15.0f; ly = 0.0f; lx = 0.0f; lz = 0.0f; break; case 'z': DzienneZwiekszanie = DzienneZwiekszanie - 0.001; break; case 'x': DzienneZwiekszanie = DzienneZwiekszanie + 0.001; break; case 'o': glDisable(GL_LIGHTING); break; case 'p': initRendering(); break; } }
/* * === FUNCTION ====================================================================== * Name: initGraphics * Description: * ===================================================================================== */ void initGraphics ( int argc, char **argv ) { glutInit( &argc, argv ); // The image is not animated so single buffering is OK. glutInitDisplayMode( GLUT_SINGLE | GLUT_RGB | GLUT_DEPTH ); // Window position (from top corner), and size (width and hieght) glutInitWindowPosition( 40, 60 ); glutInitWindowSize( (BOARD_SIZE + PANEL_WIDTH ) / 2, BOARD_SIZE / 2 ); glutCreateWindow( "Voronoi Game" ); // Initialize OpenGL as we like it.. initRendering(); // Set up callback functions for key presses glutKeyboardFunc( myKeyboardFunc ); // Handles "normal" ascii symbols // glutSpecialFunc( mySpecialKeyFunc ); // Handles "special" keyboard keys /* Set up mouse callback */ glutMouseFunc( myMouseFunc ); // Set up the callback function for resizing windows glutReshapeFunc( resizeWindow ); // Call this for background processing glutIdleFunc( idleCallback ); // call this whenever window needs redrawing glutDisplayFunc( drawScene ); }
int main (int argc, char **argv) { freopen("out.txt","w",stdout); //nam lekhar jonno...cursor.......... name[0]='_'; //texture mapping-er jonno......... BMPLoad("menu.bmp",menu5); // GLUT initialization. glutInit(&argc, argv); glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB); glutInitWindowSize(width, height); glutCreateWindow("CAR RACING"); initRendering(); // Register call backs. glutDisplayFunc(display); glutReshapeFunc(reshapeMainWindow); //glutMouseFunc(mouse); glutTimerFunc(TIMERMSECS, timer, 0); //glutIdleFunc(keyCheck); // Enter GLUT loop. glutMainLoop(); return 0; }
int main(int argc, char** argv) { glutInit(&argc, argv); glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_ALPHA); glutInitWindowSize(600, 600); glutInitWindowPosition(100, 100); glutCreateWindow("Asteroids"); initRendering(); // get some OpenGL info (Note that we can only do it after initialization or smt) GLfloat values[2]; glGetFloatv (GL_POINT_SIZE_RANGE, values); std::cout << "GL_POINT_SIZE_RANGE: " << values[0] << ", " << values[1] << std::endl; glGetFloatv (GL_LINE_WIDTH_RANGE, values); std::cout << "GL_LINE_WIDTH_RANGE: " << values[0] << ", " << values[1] << std::endl; glGetFloatv (GL_LINE_WIDTH_GRANULARITY, values); std::cout << "GL_LINE_WIDTH_GRANULARITY: " << values[0] << std::endl; glutDisplayFunc(drawScene); glutKeyboardFunc(handleKeypress); glutReshapeFunc(handleResize); glutMouseFunc(mouse); // glutIdleFunc(main_loop); glutTimerFunc(25, main_loop, 0); // start the update sequence // start handling events and such glutMainLoop(); return 0; }
int main(int argc, char **argv) { glutInit(&argc, argv); glutInitDisplayMode(GLUT_DEPTH | GLUT_DOUBLE | GLUT_RGBA); glutInitWindowPosition(100, 100); glutInitWindowSize(800, 400); glutCreateWindow("MotorCross"); _terrain = loadTerrain("heightmap.bmp", 20); //Initialize(); initRendering(); motorcycle= new Motor(motor_x,motor_y); glutReshapeFunc(windowResize); glutDisplayFunc(renderScene); // glutIdleFunc(update); glutIgnoreKeyRepeat(1); glutMouseFunc(mouseButton); glutMotionFunc(mouseMove); glutKeyboardFunc(processNormalKeys); glutSpecialFunc(pressSpecialKey); glutSpecialUpFunc(releaseSpecialKey); glEnable(GL_DEPTH_TEST); glutTimerFunc(50, update, 0); glutMainLoop(); return 0; }
int main(int argc, char** argv) { glutInit(&argc, argv); glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH); glutInitWindowSize(width, height); glutCreateWindow("minigolf"); glewInit(); initRendering(argv); //Render everything glutDisplayFunc(display); glutKeyboardFunc(handleKeyboard); glutReshapeFunc(handleResize); glutMotionFunc(handle_motion); glutMouseFunc(handle_mouse); glutMouseWheelFunc(glutMouseWheel); glutCreateMenu(handle_menu); // Setup GLUT popup menu glutAddMenuEntry("Translate", 0); glutAddMenuEntry("Rotate X", 1); glutAddMenuEntry("Rotate Y", 2); glutAddMenuEntry("Rotate Z", 3); glutAddMenuEntry("Scale", 4); glutAddMenuEntry("Quit", 5); glutAttachMenu(GLUT_RIGHT_BUTTON); //The update loop glutIdleFunc(Update); glutMainLoop(); return 0; }
int main( int argc, char** argv ) { glutInit(&argc,argv); /* The image is not animated so single buffering is OK */ glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB | GLUT_DEPTH ); /* Window position (from top corner), and size (width and hieght) */ glutInitWindowPosition( 20, 60 ); glutInitWindowSize( 360, 360 ); glutCreateWindow( "Smooth Triangle" ); /* Initialize OpenGL */ initRendering(); /* Set up the callback function for resizing windows */ glutReshapeFunc( resizeWindow ); /* Call this whenever window needs redrawing */ glutDisplayFunc( drawScene ); /* Start the main loop. glutMainLoop never returns */ glutMainLoop(); return(0); }
int main(int argc, char** argv) { //create client here client(argc,argv); //Initialize GLUT glutInit(&argc, argv); glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH); glutInitWindowPosition(700, 0);//sets coordinate of left most upper corner glutInitWindowSize(600, 600); //Set the window size //Create the window glutCreateWindow("client"); initRendering(); //Initialize rendering //Set handler functions for drawing, keypresses, and window resizes glutDisplayFunc(drawScene); glutKeyboardFunc(handleKeypress); glutReshapeFunc(handleResize); glutMouseFunc(pressedMotion); glutPassiveMotionFunc(move); glutTimerFunc(25, update, 0); glutMainLoop();//Start the main loop. glutMainLoop doesn't return. return 0; }
int main(int argc ,char **argv) { glutInit(&argc,argv); glutInitDisplayMode(GLUT_SINGLE | GLUT_RGBA | GLUT_DEPTH | GLUT_ALPHA); scanner(); generate_colors(); w = glutGet(GLUT_SCREEN_WIDTH); h = glutGet(GLUT_SCREEN_HEIGHT); glutInitWindowPosition(100,100); glutInitWindowSize(w*3/4,h*3/4); glutCreateWindow("Graphics.... :)"); initRendering(); glutDisplayFunc(draw_scene); glutReshapeFunc(reshape_window); glutKeyboardFunc(handle_keyboard_keys); glutSpecialFunc(handle_special_keyboard_keys); glutMouseFunc(click_action); //glutMotionFunc(action2); glutPassiveMotionFunc(mouse_action); //glutPostRedisplay(); glutTimerFunc(100,random_walk,0); glutTimerFunc(10,gaze_cursor,0); glutTimerFunc(update_timer,light_transport,0); //glutIdleFunc(draw_scene); glutMainLoop(); return 0; }
// Main routine // Set up OpenGL, define the callbacks and start the main loop int main( int argc, char** argv ) { glutInit(&argc,argv); // The image is not animated so single buffering is OK. glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB | GLUT_DEPTH ); // Window position (from top corner), and size (width and hieght) glutInitWindowPosition( 20, 60 ); glutInitWindowSize( 360, 360 ); glutCreateWindow( "SimpleDraw - Press space bar to toggle images" ); // Initialize OpenGL as we like it.. initRendering(); // Set up callback functions for key presses glutKeyboardFunc( myKeyboardFunc ); // Handles "normal" ascii symbols // Set up the callback function for resizing windows glutReshapeFunc( resizeWindow ); // call this whenever window needs redrawing glutDisplayFunc( drawScene ); fprintf(stdout, "Press space bar to toggle images; escape button to quit.\n"); // Start the main loop. glutMainLoop never returns. glutMainLoop( ); }
int main(int argc, char **argv) { // Initialize GLUT glutInit(&argc, argv); glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB); int w = glutGet(GLUT_SCREEN_WIDTH); int h = glutGet(GLUT_SCREEN_HEIGHT); float windowWidth = w * 9 / 11; float windowHeight = h * 9 / 11; glutInitWindowSize(windowWidth, windowHeight); glutInitWindowPosition((w - windowWidth) / 2, (h - windowHeight) / 2); glutCreateWindow("Carrom Board"); // Setup the window initRendering(); // Register callbacks glutDisplayFunc(drawScene); glutIdleFunc(drawScene); glutKeyboardFunc(handleKeypress1); glutSpecialFunc(handleKeypress2); glutMouseFunc(handleMouseclick); glutMotionFunc(dragHandler); glutReshapeFunc(handleResize); glutTimerFunc(10, update, 0); board = Board(); board.init(0.0f,0.0f); glutMainLoop(); return 0; }
bool Game::init(const mkString& cmd_line) { rtti::TypeManager::getInstance().finishTypeRegistration(); m_presetMgr = new rtti::PresetMgr; m_presetMgr->init(); parseCmdLine(cmd_line); initRendering(); initInput(); initPhysics(); #ifdef ENABLE_BULLET_DEBUG_DRAW g_debugPhysicsDrawer = new BtOgre::DebugDrawer(m_ogreSceneMgr->getRootSceneNode(), m_physicsWorld); m_physicsWorld->setDebugDrawer(g_debugPhysicsDrawer); #endif m_actorControllerFactory = new ActorControllerFactory; m_level = new Level(); if (!m_level->load("data/levels/" + m_levelName + ".json")) return false; m_freelook = m_startWithFreelook; //Set Player conflict side to Neutral m_level->getPlayer()->setConflictSide(EConflictSide::Unknown); return true; }
int main(int argc, char **argv) { glutInit(&argc, argv); alutInit (&argc, argv); glutInitDisplayMode(GLUT_DEPTH | GLUT_DOUBLE | GLUT_RGBA); glutInitWindowPosition(100,100); glutInitWindowSize(800,600); glutCreateWindow("Sky fighter"); Audio.Initializer(); // Audio.PlayDemo(); initRendering(); glutDisplayFunc(renderScene); glutKeyboardFunc(keyboard); glutKeyboardUpFunc(keyboardUp); glutSpecialFunc(keySpecial); glutIdleFunc(renderScene); glutReshapeFunc(changeSize); glLightfv(GL_LIGHT0, GL_POSITION, lightPos); glEnable(GL_DEPTH_TEST); glEnable(GL_LIGHTING); glEnable(GL_LIGHT0); glEnable(GL_COLOR_MATERIAL); glutMainLoop(); return 0; }
int main(int argc, char *argv[]) { CommandLine cmdLineArgs; cmdLineArgs.parse(argc,argv); cmdLineArgs.printArguments(); if(cmdLineArgs.noGUI) g_visualize=false; srand(3213212); //initWindow(640,480,false,false); initWindow(960,540,false,false); //initWindow(1280,720,false,true); initRendering(); //* QuadroEvolutionHarness quadroEvo(42); quadroEvo.evolve(false); quadroEvo.printStatistics(); /*/ quadroLoop(cmdLineArgs.inFileName,cmdLineArgs.outFileName,cmdLineArgs.loopPlayback,cmdLineArgs.useHardware); //*/ terminateGraphics(); glfwTerminate(); terminatePhysics(); }
int main(int argc, char** argv) { glutInit(&argc, argv); glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH); glutGameModeGet(GLUT_GAME_MODE_POSSIBLE); if(GLUT_GAME_MODE_POSSIBLE) { glutEnterGameMode(); } else { RECT desktop; // Get a handle to the desktop window const HWND hDesktop = GetDesktopWindow(); // Get the size of screen to the variable desktop GetWindowRect(hDesktop, &desktop); width = desktop.right; height = desktop.bottom-65; glutInitWindowSize(desktop.right, desktop.bottom-55); glutInitWindowPosition (0,0); glutCreateWindow("Six Sides of Destruction"); } initRendering(); glutDisplayFunc(screen_title); glutKeyboardFunc(handle_titlescreen_key); glutReshapeFunc(handleResize); glutTimerFunc(2, update, 0); glutMainLoop(); return 0; }
void init(int argc, char **argv, uint displayMode, position initPos, size initSize, string windowTitle ) { glutInit(&argc, argv); //Simple buffer glutInitDisplayMode(displayMode); glutInitWindowPosition(initPos.getX(),initPos.getY()); glutInitWindowSize(initSize.getWidth(),initSize.getHeight()); glutCreateWindow(windowTitle.c_str()); initRendering(); glutDisplayFunc(draw); glutIdleFunc(animate); glutKeyboardFunc(keyboardListener); glutSpecialFunc(specialKeyListener); glutMouseFunc(mouseListener); //Call to the drawing function }
void init(void) { initExtensionEntries (); initBuffer (); initShader (); initRendering (); }
void VisualizeSurfaceMesh::Process(int argc, char** argv){ glutInit(&argc, argv); glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH); glutInitWindowSize(Kinect::Width, Kinect::Height); //Window0 WindowID[0] = glutCreateWindow("PlaneFitted"); Capture1.setWriteFile("PlaneFitted"); initRendering(); glutDisplayFunc(renderOutputTexture); glutKeyboardFunc(handleKeypress); glutReshapeFunc(handleResize); glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH); glutInitWindowSize(Kinect::Width, Kinect::Height); //Window1 WindowID[1] = glutCreateWindow("Filtered"); Capture2.setWriteFile("Filtered"); initRendering(); glutDisplayFunc(renderInputTexture); glutKeyboardFunc(handleKeypress); glutReshapeFunc(handleResize); ////Window2 //WindowID[2] = glutCreateWindow("Segmented"); //Capture3.setWriteFile("Segmented"); //initRendering(); // //glutDisplayFunc(renderSegmentedTexture); //glutKeyboardFunc(handleKeypress); //glutReshapeFunc(handleResize); // ////Window3 //WindowID[3] = glutCreateWindow("Merged"); //Capture4.setWriteFile("Merged"); //initRendering(); // //glutDisplayFunc(renderMergedTexture); //glutKeyboardFunc(handleKeypress); //glutReshapeFunc(handleResize); glutIdleFunc(idle); glutMainLoop(); }
void Window3D::resizeEvent(QResizeEvent *event) { QWindow::resizeEvent(event); if (!m_canRender) { initRendering(); } }
void initWindows() { glutKeyboardFunc(myKeyboard); glutMouseFunc(mouse); initRendering(); glutReshapeFunc(ChangeSize); glutSpecialFunc(teclasUPandDown); }
// Main routine // Set up OpenGL, define the callbacks and start the main loop int main( int argc, char** argv ) { if (argc != 2) { printf("Usage: ./main [rec|prob]"); printf("\n"); return 1; } char* number_of_iterations = argv[1]; if (strcmp(number_of_iterations, "prob") == 0) { mode = 2; } else if (strcmp(number_of_iterations, "rec") == 0) { mode = 1; } else { printf("Usage: ./main [rec|prob]"); printf("\n"); return 1; } srand(time(NULL)); glutInit(&argc,argv); // The image is not animated so single buffering is OK. glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB | GLUT_DEPTH ); // Window position (from top corner), and size (width and hieght) glutInitWindowPosition( 20, 60 ); glutInitWindowSize( 500, 500 ); glutCreateWindow( "2014 KGPS2 Oleg Popok. Press space bar for the next step" ); // Initialize OpenGL as we like it.. initRendering(); // Set up callback functions for key presses glutKeyboardFunc( myKeyboardFunc ); // Handles "normal" ascii symbols // glutSpecialFunc( mySpecialKeyFunc ); // Handles "special" keyboard keys // Set up the callback function for resizing windows glutReshapeFunc( resizeWindow ); // Call this for background processing // glutIdleFunc( myIdleFunction ); // call this whenever window needs redrawing glutDisplayFunc( drawScene ); fprintf(stdout, "Fraktalas 50.png.\n"); // Start the main loop. glutMainLoop never returns. glutMainLoop( ); return(0); // This line is never reached. }
void init(void) { initBuffer(); // set OpenGL state variables f/ viewing, attributes #if (defined __linux__ || defined __unix__) initShaders("./shaders/phong.vert", "./shaders/phong.frag"); #else initShaders("../shaders/phong.vert", "../shaders/phong.frag"); #endif initRendering(); }
int main(int argc, char ** argv) { glutInit(&argc, argv); //glutInitDisplayMode(GLUT_RGBA | GLUT_DOUBLE); glutInitDisplayMode (GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH); glutCreateWindow("Dado"); glEnable(GL_DEPTH_TEST); initRendering(); glutDisplayFunc(display); glutKeyboardFunc(keyboard); glutMainLoop(); }//main