import std.cstream; import std.string; import SDL; import SDL_ttf; int main(char[][] args) { if (args.length < 2) { dout.writeLine("HIKISUU KUDASAI"); return 0; } dout.writeLine("show " ~ args[1]); SDL_Init(SDL_INIT_VIDEO); TTF_Init(); TTF_Font* font = TTF_OpenFont(args[1], 18); SDL_Color color; color.r = 255; color.g = 255; color.b = 255; SDL_Surface* image = TTF_RenderText_Solid(font, "Brown fox ...", color); SDL_WM_SetCaption(args[0], "showfont"); SDL_Surface* scr = SDL_SetVideoMode(image.w, image.h, 16, SDL_SWSURFACE); SDL_BlitSurface(image, cast(SDL_Rect*)0, scr, cast(SDL_Rect*)0); SDL_UpdateRect(scr, 0,0,0,0); while (1) { SDL_Event ev; SDL_PollEvent(&ev); if (ev.type == SDL_QUIT) break; SDL_Delay(33); } TTF_CloseFont(font); TTF_Quit(); SDL_Quit(); return 0; }