int main(int argc, char * argv[]) { int i; for(i = 1; i < argc; i++) { if(!strcmp(argv[i], "--width")) { if(argc > i) { vwidth = atoi(argv[i + 1]); } } if(!strcmp(argv[i], "--height")) { if(argc > i) { vheight = atoi(argv[i + 1]); } } } if(!mapper_initialize()) { return -1; } t3f_run(); return 0; }
int main(int argc, char * argv[]) { if(!t3f_initialize("ex_tilemap", 640, 480, 60.0, logic, render, T3F_USE_KEYBOARD | T3F_USE_MOUSE, NULL)) { return 1; } font = al_load_bitmap_font("data/font.png"); if(!font) { return 1; } tileset = t3f_load_tileset("data/tileset.tts"); if(!tileset) { return 1; } tilemap = t3f_load_tilemap("data/tilemap.ttm"); if(!tilemap) { return 1; } camera.x = 0; camera.y = 0; camera.z = 0; t3f_run(); return 0; }
int main(int argc, char * argv[]) { if(!t3f_initialize("ex_gui", 640, 480, 60.0, logic, render, T3F_USE_KEYBOARD | T3F_USE_MOUSE, NULL)) { return 1; } bitmap = al_load_bitmap("data/bitmap.png"); if(!bitmap) { return 1; } font = al_load_bitmap_font("data/font.png"); if(!font) { return 1; } t3f_set_gui_driver(NULL); page = t3f_create_gui(0, 0); t3f_add_gui_text_element(page, red_proc, "Red", font, 16, 0, t3f_color_white, T3F_GUI_ELEMENT_SHADOW); t3f_add_gui_text_element(page, green_proc, "Green", font, 16, 24, t3f_color_white, T3F_GUI_ELEMENT_SHADOW); t3f_add_gui_text_element(page, blue_proc, "Blue", font, 16, 48, t3f_color_white, T3F_GUI_ELEMENT_SHADOW); t3f_add_gui_image_element(page, black_proc, bitmap, 16, 120, T3F_GUI_ELEMENT_SHADOW); t3f_run(); return 0; }
int main(int argc, char * argv[]) { if(!csd_initialize(argc, argv)) { return -1; } t3f_run(); return 0; }
int main(int argc, char * argv[]) { if(!demo_initialize(argc, argv)) { printf("Failed to initialize!\n"); return 1; } t3f_play_music("demo_music.ogg", 0.0, 0.0); t3f_run(); t3f_stop_music(); return 0; }
int main(int argc, char * argv[]) { APP_INSTANCE app; if(app_initialize(&app, argc, argv)) { t3f_run(); } else { printf("Error: could not initialize T3F!\n"); } return 0; }
int main(int argc, char * argv[]) { int i; char fn[1024] = {0}; if(!t3f_initialize("ex_atlas", 640, 480, 60.0, logic, render, T3F_USE_KEYBOARD | T3F_USE_MOUSE, NULL)) { return 1; } t3f_srand(&rng_state, time(0)); /* load bitmaps into sprite sheet */ atlas = t3f_create_atlas(512, 512); if(!atlas) { printf("Failed to create atlas!\n"); return 0; } for(i = 0; i < 8; i++) { sprintf(fn, "data/%d.png", i); bitmap[i] = al_load_bitmap(fn); if(!bitmap[i]) { return 1; } t3f_add_bitmap_to_atlas(atlas, &bitmap[i], T3F_ATLAS_SPRITE); } for(i = 0; i < 1024; i++) { object[i].x = t3f_drand(&rng_state) * 640.0; object[i].y = t3f_drand(&rng_state) * 480.0; object[i].vx = t3f_drand(&rng_state) * 4.0 - 2.0; object[i].vy = t3f_drand(&rng_state) * 4.0 - 2.0; object[i].bitmap = t3f_rand(&rng_state) % 8; } t3f_run(); return 0; }
int main(int argc, char * argv[]) { if(!paddle_initialize()) { return 1; } /* play the menu music - setting both loop points to 0.0 makes the entire song loop - if your song has loop points, pass them here (paramaters are read as seconds) */ t3f_play_music("data/music/menu.xm"); /* run the T^3 Framework - exits when you call t3f_exit() somewhere in your logic routine - clicking the close button in windowed mode calls t3f_exit() */ t3f_run(); /* stop the music before exiting */ t3f_stop_music(); return 0; }