Esempio n. 1
0
int main(int argc, char** argv)
{
	window_initAll();
	Character* tigre = character_Init("./data/spritesheet.bmp");
	Character* trump = character_Init("./data/spritesheet2.bmp");
	Background* decors = background_Load("./data/decors.bmp");

	//recuperation des dimensions de la texture
	//texture_info BGInfo={0,0,0,0};

	//source du sprite

	//destination de depart du sprite
	decors->dstRect = background_setCentered(decors);
	tigre->fg.dstRect  = (SDL_Rect){0,0,64,24};
	trump->fg.dstRect  = (SDL_Rect){100,100,128,128};

	//Copie de la texture dans le rendu
	background_copyAllToRender();
	character_copyAllToRender();
	//rafraichissement du rendu dans la fenetre
	SDL_RenderPresent(getRenderer());

	mainEventLoop();
	//destruction de tout les assets
	character_DestroyAll();
	background_DestroyAll();
	//destruction du moteur de rendu
	SDL_DestroyRenderer(getRenderer());

	SDL_Quit();

	return 0;
}
Esempio n. 2
0
int
main(int argc, char **argv)
{
    int ret_status;

    /* Initialize some global values */
/*    fprintf(stderr,"hyper:main:entered\n");*/
    gArgc = argc;
    gArgv = argv;
    gIsEndOfOutput = 1;

/*    fprintf(stderr,"hyper:main:calling  check_arguments\n");*/
    check_arguments();
/*    fprintf(stderr,"hyper:main:returned check_arguments\n");*/

    /*
     * initialize the hash tables for the files and the windows and images
     */
/*    fprintf(stderr,"hyper:main:calling  init_hash\n");*/
    init_hash();
/*    fprintf(stderr,"hyper:main:returned init_hash\n");*/

    /*
     * initialize the parser keyword hash table
     */
/*    fprintf(stderr,"hyper:main:calling  parser_init\n");*/
    parser_init();
/*    fprintf(stderr,"hyper:main:returned parser_init\n");*/

/*    fprintf(stderr,"hyper:main:calling  read_ht_db\n");*/
    read_ht_db(&init_page_hash, &init_macro_hash, &init_patch_hash);
/*    fprintf(stderr,"hyper:main:returned read_ht_db\n");*/

    /*
     * Now initialize x. This includes opening the display, setting the
     * screen and display global values, and also gets all the fonts and
     * colors we will need.
     */

    if (!make_input_file && !gmake_record_file && !gverify_record_file) {
/*        fprintf(stderr,"hyper:main:calling  initializeWindowSystem\n");*/
        initializeWindowSystem();
/*        fprintf(stderr,"hyper:main:returned initializeWindowSystem\n");*/

        /*
         * Initialize some of the global values used by the input string
         * routines
         */
/*        fprintf(stderr,"hyper:main:calling  init_keyin\n");*/
        init_keyin();
/*        fprintf(stderr,"hyper:main:returned init_keyin\n");*/

        /*
         * regardless of what else happened, we should always pop up an
         * initial window.
         */

/*        fprintf(stderr,"hyper:main:calling  init_top_window\n");*/
        ret_status = init_top_window("RootPage");
/*        fprintf(stderr,"hyper:main:returned init_top_window\n");*/
        gParentWindow = gWindow;
        if (ret_status == -1) {
            fprintf(stderr,
               "(HyperDoc) Could not find RootPage for top-level window.\n");
            exit(-1);
        }

        /*
         * Tell it how to handle the user defined signals I may get
         */
        bsdSignal(SIGUSR2, sigusr2_handler,RestartSystemCalls);
        bsdSignal(SIGUSR1, SIG_IGN,RestartSystemCalls);
#if defined(BSDplatform) || defined(MACOSXplatform)
        bsdSignal(SIGCHLD, sigcld_handler,RestartSystemCalls);
#else
        bsdSignal(SIGCLD, sigcld_handler,RestartSystemCalls);
#endif
        bsdSignal(SIGINT, SIG_IGN,RestartSystemCalls);

        /*
         * Now go to the main event loop. I will never return, so just end
         * the main routine after that
         */

        /*
         * make an input file if requested
         */
    }
    else {

        /*
         * Try to establish all the socket connections I need. If I am an
         * is_fricas_server and the routine fails, it will exit for me
         */
/*        fprintf(stderr,"hyper:main:in else case\n");*/
/*        fprintf(stderr,"hyper:main:calling  make_server_connections\n");*/
        make_server_connections();
/*        fprintf(stderr,"hyper:main:returned make_server_connections\n");*/


        if (make_input_file) ht2_input();
        if (gmake_record_file) make_record();
        if (gverify_record_file) verify_record();
        exit(0);
    }

    /*
     * Try to establish all the socket connections I need. If I am an
     * is_fricas_server and the routine fails, it will exit for me
     */
/*    fprintf(stderr,"hyper:main:calling  make_server_connections\n");*/
    make_server_connections();
/*    fprintf(stderr,"hyper:main:returned make_server_connections\n");*/


/*    fprintf(stderr,"hyper:main:calling  mainEventLoop\n");*/
    mainEventLoop();
/*    fprintf(stderr,"hyper:main:returned mainEventLoop\n");*/

    return 0;
}