示例#1
0
文件: FSP.cpp 项目: ponyatov/F
fsTeX::~fsTeX()	{
	title=texify(title);
	author=texify(author);
	document=texify(document);
	fprintf(fh,"%s",header.c_str());
	fprintf(fh,"\\title{%s}\n",title.c_str());
	fprintf(fh,"\\author{%s}\n",author.c_str());
	fprintf(fh,"\\begin{document}\n");
	fprintf(fh,"%s",document.c_str());
	fprintf(fh,"\\end{document}\n");
	fclose(fh); 
}
int st1_init(State* state)
{
  Image* img = NULL;
  SDL_Surface* surface;

  img = (Image*)malloc_or_die(sizeof(Image),
                              "Unable to alloc struct for image\n");
  printf("trying to load image...\n");
  surface = get_image(testpic_bmp, testpic_bmp_len);
  if(img == NULL) {
    printf("nyoo, can't load this cuute image /(0o0)\\\n");
    crash();
  }
  printf("loaded image \\(^o^)/\n");

  *img = texify(surface, state->stateman->renderer.sdl_renderer,
                state->stateman->window);

  datapush(img, &state->data);

  free(surface);
  return 0;
}