Exemplo n.º 1
0
int main(int argc, char **argv)
{
#ifdef HAVE_FT2
  const char *text = "Test text!";
  const char *font = "arial.ttf";
  const char *file = "ttftest.gif";
  const char *bg = "heading-yellow.gif";
  const char *color = "#000000";
  
  log_init(STDOUT_FILENO, LOG_ALL, L_warning);
  io_init_except(STDOUT_FILENO, STDOUT_FILENO, STDOUT_FILENO);
  mem_init();
  dlink_init();
  gif_init();
  image_init();
  ttf_init();
  
  ttftest_log = log_source_register("ttftest");
  
  log_level(LOG_ALL, L_verbose);
  
  if(argc > 1)
    text = argv[1];
  if(argc > 2)
    font = argv[2];
  if(argc > 3)
    file = argv[3];
  if(argc > 4)
    bg = argv[4];
  if(argc > 5)
    color = argv[5];

  ttftest_write(text, font, file, bg, color);

  log_level(LOG_ALL, L_warning);
  
  log_source_unregister(ttftest_log);
  
  ttf_shutdown();
  image_shutdown();
  gif_shutdown();
  dlink_shutdown();
  mem_shutdown();
  log_shutdown();
  io_shutdown();
#endif  
  return 0;
}
Exemplo n.º 2
0
int main (int argc, char *argv[]) 
{
    if (!freopen("stdout.txt", "w", stdout)) {
	ERR("Failed to open stdout.txt");
    }

    if (!freopen("stderr.txt", "w", stderr)) {
	ERR("Failed to open stderr.txt");
    }

    color_init();

    if (!config_init()) {
	DIE("Config init");
    }

    if (!sdl_init(video_w, video_h)) {
	DIE("SDL init");
    }

    if (!ttf_init()) {
	DIE("TTF init");
    }

    if (!console_init()) {
	DIE("No console");
    }

    gl_enter_2d_mode();

    console_log("hello\n");
    console_log("there\n");
    console_log("thereabcdefghijklmnopqrstuvwxyz\n");
    console_log("abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\n");
    sdl_loop();
    gl_leave_2d_mode();

    quit();

    LOG("Exit(0)");

    return (0);
}