예제 #1
0
void close( Tile* tiles[] )
{
	//Deallocate tiles
	for( int i = 0; i < TOTAL_TILES; ++i )
	{
		 if( tiles[ i ] == NULL )
		 {
			delete tiles[ i ];
			tiles[ i ] = NULL;
		 }
	}

	//Free loaded images
	gDotTexture.free();
	gTileTexture.free();

	//Destroy window	
	SDL_DestroyRenderer( gRenderer );
	SDL_DestroyWindow( gWindow );
	gWindow = NULL;
	gRenderer = NULL;

	//Quit SDL subsystems
	IMG_Quit();
	SDL_Quit();
}
예제 #2
0
void close()
{
    gSceneTexture.free();
    gHelp.free();
    gPtrHelp = NULL;
    board.freeBoard();

    for (int i = 0; i < NUMBER_OF_TILE * 4; ++i)
    {
        gTile[i].freeButton();
    }
    for (int i = 0; i < NUMBER_OF_BUTTON; ++i)
    {
        gButton[i].freeButton();
    }
    TTF_CloseFont(gFont);
    gFont = NULL;

    SDL_DestroyRenderer(gRenderer);
    gRenderer = NULL;
    gWindow.free();

    TTF_Quit();
    IMG_Quit();
    SDL_Quit();
}
예제 #3
0
파일: timing.cpp 프로젝트: LXiong/blog_tmp
void
close_sdl(void)
{
	printf("close_sdl()\n");

	/* free loaded image */
	gPromptTexture.free();
	gTimeTextTexture.free();

	/* free global font */
	TTF_CloseFont(gFont);
	gFont = NULL;


	/* destroy window */
	SDL_DestroyRenderer(gRenderer);
	SDL_DestroyWindow(gWindow);
	gWindow = NULL;
	gRenderer = NULL;


	/* Quit SDL subsystem */
#ifdef _SDL_TTF_H
	TTF_Quit();
#endif
	IMG_Quit();
	SDL_Quit();
}
예제 #4
0
	~SimLedBar()
	{
		//Free loaded images
		offTexture_.free();
		greenTexture_.free();
		orangeTexture_.free();
		redTexture_.free();
	}
예제 #5
0
void close() {
  //Free loaded images
  gDotTexture.free();
  gBGTexture.free();

  //Destroy window
  SDL_DestroyRenderer( gRenderer );
  SDL_DestroyWindow( gWindow );
  gWindow = NULL;
  gRenderer = NULL;

  //Quit SDL subsystems
  IMG_Quit();
  SDL_Quit();
}
예제 #6
0
파일: main.cpp 프로젝트: xysun/batman1
void close(){
    
    // save game state
    SDL_RWops* file = SDL_RWFromFile("gamestates/01.bin", "w+b");
    if (file != NULL) {
        SDL_RWwrite(file, &gameState, sizeof(gameState), 1);
        printf("game state saved! \n");
        SDL_RWclose(file);
    }
    else{
        printf("fail to save game state! \n");
    }
    
    batman->close();
    
    gBackGroundTexture.free();
    
    SDL_DestroyRenderer(gRenderer);
    SDL_DestroyWindow(gWindow);
    gRenderer = NULL;
    gWindow = NULL;
    
    IMG_Quit();
    SDL_Quit();
}
void close()
{
	//Free loaded images
	gPromptTexture.free();

	//Free the sound effects
	Mix_FreeChunk( gScratch );
	Mix_FreeChunk( gHigh );
	Mix_FreeChunk( gMedium );
	Mix_FreeChunk( gLow );
	gScratch = NULL;
	gHigh = NULL;
	gMedium = NULL;
	gLow = NULL;

	//Free the music
	Mix_FreeMusic( gMusic );
	gMusic = NULL;

	//Destroy window
	SDL_DestroyRenderer( gRenderer );
	SDL_DestroyWindow( gWindow );
	gWindow = NULL;
	gRenderer = NULL;

	//Quit SDL subsystems
	Mix_Quit();
	IMG_Quit();
	SDL_Quit();
}
예제 #8
0
void close() {
  //Free loaded images
  gPressTexture.free();
  gUpTexture.free();
  gDownTexture.free();
  gLeftTexture.free();
  gRightTexture.free();

  //Destroy window
  SDL_DestroyRenderer( gRenderer );
  SDL_DestroyWindow( gWindow );
  gWindow = NULL;
  gRenderer = NULL;

  //Quit SDL subsystems
  IMG_Quit();
  SDL_Quit();
}
예제 #9
0
void close(){
	//Free loaded images
	gBallTexture.free();
	gFPSTextTexture.free();

	//Free global font
	TTF_CloseFont( gFont );
	gFont = NULL;

	//Destroy window	
	SDL_DestroyRenderer(gRenderer);
	SDL_DestroyWindow(gWindow);
	gWindow = NULL;
	gRenderer = NULL;

	//Quit SDL subsystems
	IMG_Quit();
	SDL_Quit();
}
예제 #10
0
void close()
{
	gFontTexture.free();

	SDL_DestroyRenderer(gRenderer);
	SDL_DestroyWindow(gWindow);
	gWindow = NULL;
	gRenderer = NULL;

	IMG_Quit();
	SDL_Quit();
}
예제 #11
0
void close() {
  //Free loaded images
  gTimeTextTexture.free();
  gStartPromptTexture.free();
  gPausePromptTexture.free();

  //Free global font
  TTF_CloseFont( gFont );
  gFont = NULL;

  //Destroy window
  SDL_DestroyRenderer( gRenderer );
  SDL_DestroyWindow( gWindow );
  gWindow = NULL;
  gRenderer = NULL;

  //Quit SDL subsystems
  TTF_Quit();
  IMG_Quit();
  SDL_Quit();
}
예제 #12
0
void close()
{
    //Free loaded images
    gSceneTexture.free();

    //Destroy window
    SDL_DestroyRenderer( gRenderer );
    gWindow.free();

    //Quit SDL subsystems
    IMG_Quit();
    SDL_Quit();
}
예제 #13
0
void close() {
  //Free loadded images
  g_sceneTexture.free();
  
  //Destroy window
  SDL_DestroyRenderer(g_renderer);
  g_window.free();

  //Quit SDL subsystem
  TTF_Quit();
  IMG_Quit();
  SDL_Quit();
}
예제 #14
0
void close()
{
    // Free loaded image from texture
    gCircleTexture.free();
    gBackgroundTexture.free();
    SDL_DestroyTexture(gTexture);
    gTexture = NULL;


    // Free loaded image from surface
    SDL_FreeSurface( gCurrentSurface );
    gCurrentSurface = NULL;

    // Destroy window
    SDL_DestroyRenderer(gRenderer);
    SDL_DestroyWindow(gWindow);
    gWindow = NULL;
    gRenderer = NULL;

    //Quit SDL subsystems
    IMG_Quit();
    SDL_Quit();
}
예제 #15
0
파일: camera.cpp 프로젝트: wedemalm/lazyfoo
void close() {
  //Free loaded images
  g_dotTexture.free();

  //Destroy window
  SDL_DestroyRenderer(g_renderer);
  SDL_DestroyWindow(g_window);
  g_window   = NULL;
  g_renderer = NULL;

  //Quit SDL subsystem
  IMG_Quit();
  SDL_Quit();
  Mix_Quit();
}
예제 #16
0
//Cette fonction effectue une fermeture appropriée du programme, de l'environnement SDL et libère la mémoire des différents éléments SDL créés
void close()
{

  //On détruit les LTextures créées dans le programme
  hommeTexture.free();

  //Destroy window
  SDL_DestroyRenderer(rendererFenetre);
  SDL_DestroyWindow(fenetreProgramme);
  fenetreProgramme = NULL;
  rendererFenetre = NULL;

  //Quit SDL subsystems
  IMG_Quit();
  SDL_Quit();
}
예제 #17
0
void
close_sdl(void)
{
	printf("close_sdl()\n");

	/* free loaded image */
	gModulatedTexture.free();

	/* destroy window */
	SDL_DestroyRenderer(gRenderer);
	SDL_DestroyWindow(gWindow);
	gWindow = NULL;
	gRenderer = NULL;

	/* Quit SDL subsystem */
	IMG_Quit();
	SDL_Quit();
}
예제 #18
0
void close()
{
	//Free loaded images
	gSplashTexture.free();

	//Free semaphore
	SDL_DestroySemaphore( gDataLock );
	gDataLock = NULL;

	//Destroy window	
	SDL_DestroyRenderer( gRenderer );
	SDL_DestroyWindow( gWindow );
	gWindow = NULL;
	gRenderer = NULL;

	//Quit SDL subsystems
	IMG_Quit();
	SDL_Quit();
}
void close()
{
	//Open data for writing
	SDL_RWops* file = SDL_RWFromFile( "33_file_reading_and_writing/nums.bin", "w+b" );
	if( file != NULL )
	{
		//Save data
		for( int i = 0; i < TOTAL_DATA; ++i )
		{
			SDL_RWwrite( file, &gData[ i ], sizeof(Sint32), 1 );
		}

		//Close file handler
		SDL_RWclose( file );
	}
	else
	{
		printf( "Error: Unable to save file! %s\n", SDL_GetError() );
	}

	//Free loaded images
	gPromptTextTexture.free();
	for( int i = 0; i < TOTAL_DATA; ++i )
	{
		gDataTextures[ i ].free();
	}

	//Free global font
	TTF_CloseFont( gFont );
	gFont = NULL;

	//Destroy window	
	SDL_DestroyRenderer( gRenderer );
	SDL_DestroyWindow( gWindow );
	gWindow = NULL;
	gRenderer = NULL;

	//Quit SDL subsystems
	TTF_Quit();
	IMG_Quit();
	SDL_Quit();
}
예제 #20
0
void close() {
  //Free loaded images
  gSplashTexture.free();

  //Close game controller with haptics
  SDL_HapticClose( gControllerHaptic );
  SDL_JoystickClose( gGameController );
  gGameController = NULL;
  gControllerHaptic = NULL;

  //Destroy window
  SDL_DestroyRenderer( gRenderer );
  SDL_DestroyWindow( gWindow );
  gWindow = NULL;
  gRenderer = NULL;

  //Quit SDL subsystems
  IMG_Quit();
  SDL_Quit();
}
예제 #21
0
void
close_sdl(void)
{
	printf("close_sdl()\n");

	/* free loaded image */
	gDotTexture.free();


	/* destroy window */
	SDL_DestroyRenderer(gRenderer);
	SDL_DestroyWindow(gWindow);
	gWindow = NULL;
	gRenderer = NULL;


	/* Quit SDL subsystem */
#ifdef _SDL_TTF_H
	TTF_Quit();
#endif
	IMG_Quit();
	SDL_Quit();
}