Example #1
0
int main (int argc, char** argv)
{
	initializeCamera();
	initializeSound();
	initializeGraphics(argc, argv);
	return 0;
}
Example #2
0
int main(int argc, char* argv[])
{
	glutInit(&argc,argv);
	initializeGraphics();
	glutMainLoop();
	cleanup();
	return 0;
}
Example #3
0
void main(int argc, char **argv)
{
	glutInit(&argc, argv);	//Initialize the tool kit
	initWindow();
	registerCallbacks();
	initializeGraphics();
	glutMainLoop();

}
Example #4
0
Renderer::Renderer(Conway* conway)
{
	this->space = conway->space;
	this->settings = conway->settings;
	this->conway = conway;

	initializeGlut();
	initializeGraphics();
	initializeCamera();
	initializePixels();
}
void ScheduleScreen::showEvent(QShowEvent *e)
{
    if(!m_initialized)
    {
        e->accept();
        currentPoint = NULL;
        m_initialized = true;
        view->show();
        QTimer::singleShot(0, this, SLOT(initializeGraphics()));
    }
}
void loadGame() {
    initializeGraphics();
    #if enableBackgroundMusic
        //now we need to load our background music
        printf("background music should load...\n");
        play_ogg(BGM_FILE,true);
    #else
        println("background music is disabled.");
    #endif
        play_ogg(MACHINEGUN_SOUND, true);
}
Example #7
0
int main(int argc, char **argv)
{	
	sound = new SoundEngine();

    // Check if input file was given, if not use default
    if(argc > 1){
        fileIO->processFile(argv[1]);
        // Make sure that file was correctly read and parsed
        if(fileIO->getNumHoles() <= 0){
            cout << "Error reading file. Using default instead." << endl;
			fileIO->processFile(DEFAULT_COURSE);
        }
    }
    else{
        cout << "No input file was provided." << endl;
        // Create default level since no file was specified
        fileIO->processFile(DEFAULT_COURSE);
    }

	// Load level
	levelController->loadFirstLevel(fileIO);

	// Add Player
	addNewPlayer(0);

    // Move arrow to ball's starting position
    arrow->translate(levelController->getCurrentLevel()->getBall()->getPhysics()->getPosition());
    arrow->translate(glm::vec3(0.0, BALL_OFFSET, 0.0));

    // Add shapes to game level
    shapes.clear();
    shapes = levelController->getCurrentLevel()->getLevelShapes();
    reloadAllShapes(&verts, &color, &norms, shapes);

	initializeGraphics(argc, argv, "MiniGolf", 1280, 720);  

    glutMainLoop();

	// Clean-up -- NEED TO ADD THE REST OF THIS
    if(shader) delete shader;
    if(levelController) delete levelController;
    if(fileIO) delete fileIO;
    if(arrow) delete arrow;
	if(sound) delete sound;

	return 0;
}
Example #8
0
void main(int argc, char** argv)
{
    W = 800; H = 800;

    int windowHandle = glutCreateWindow("Program 2");
    glutInitDisplayMode ( GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH );
	glEnable(GLUT_RGBA);
    glutSetWindow(windowHandle);
    glutPositionWindow ( 100, 10 );
    glutReshapeWindow( W, H );
    initializeGraphics();
    glutDisplayFunc(display);
    glutReshapeFunc(reshape);
    glutIdleFunc(update);
    glutSpecialFunc( specialChar );
    glutKeyboardFunc( keyBoard );
	glutMouseFunc( mouseFunc );
	glutPassiveMotionFunc(idleMouse);
    glutMainLoop();
	cleanup();
}
Example #9
0
void LegacyMenu::onRaceDriversLoaded()
{
    if (_piRaceEngine->inData()->_displayMode == RM_DISP_MODE_NORMAL)
	{
        // It must be done after the cars are loaded and the track is loaded.
        // The track will be unloaded if the event ends.
        // The graphics module is kept open if more than one race is driven.

        // Initialize the graphics and sound engines.
        if (initializeGraphics() && initializeSound())
		{
            char buf[128];
            snprintf(buf, sizeof (buf), "Loading graphics for %s track ...",
                    _piRaceEngine->inData()->track->name);
            addLoadingMessage(buf);

            // Initialize the track graphics.
            loadTrackGraphics(_piRaceEngine->inData()->track);
        }
    }
}
Example #10
0
int main()
{
	initializeGraphics();	

	MouseType mouseObject = IDLE;

	int cursorXLocation = 10;
	int cursorYLocation = 10;

	// These control building & unit logic
	GameEntity* buildingsContainer = NULL;
	GameEntity* unitsContainer = NULL;

	uint16_t population = 0;		// This controls population count
	uint16_t frame = 0;				// This counts frames
	uint16_t unitSpawnDelay = 0;			// This controls the delay between unit spawns

	while (true)
	{
		FlipBuffers();																				// Flip buffers
		
		ClearScreen8(SAND_COLOR);																	// Clear screen

		render(buildingsContainer,unitsContainer);													// Render all buildings and units

		animatePowerPlant(frame);																	// Animate the power plant
		animateBarracks(frame);																		// Animate the barracks

		if(mouseObject!=IDLE)																		// If there has been some mouse action ...
		{
			if(isMovement(mouseObject))																	// ... and it is movement ...
			{
				move(cursorXLocation,cursorYLocation,mouseObject);											// ... movet the mouse.
			}
			 
			else if(isPlacement(mouseObject))															// ... if it is placement ...
			{
				place(cursorXLocation,cursorYLocation,mouseObject,buildingsContainer);						// ... attempt placement.
			}

			else if(isSpawning(mouseObject) && unitSpawnDelay==0 && population!=POP_CAP)				// ... if it is a unit and it's not to soon after the last unit was trained and population cap has not been reached  ...
			{														
				spawn(unitsContainer,buildingsContainer);													// place the unit
				population++;																				// increase population

				unitSpawnDelay = UNIT_SPAWN_COOLDOWN_PERIOD;												// start cooldown timer
			}
		}

		drawCursor(cursorXLocation,cursorYLocation);												// Draw the cursor

		mouseObject = updatedMouseType();															// Update the mouse

		WaitVSync();																				// Sync

		frame = (frame == 100) ? 0 : frame+1;														//	Reset frame count every 100 frames, else increase by one

		if(unitSpawnDelay!=0)																		// If there is a cooldown timer in action ...
			unitSpawnDelay--;																			// ... update it!

	}
	
	// We are environmentaly concious, so we clean after ourselves
	delete buildingsContainer;					
	delete unitsContainer;

	return 0;
}