level 5
rabbie1986
楼主
用的这个函数输出文字
void PrintTTF(char* ch, int x, int y, int FontSize, SDL_Color Color)
{
font = TTF_OpenFont("font.ttf", FontSize);
sur = TTF_RenderUTF8_Solid(font, ch, Color);
TTF_CloseFont(font);
tex = SDL_CreateTextureFromSurface(ren, sur);
SDL_FreeSurface(sur);
SDL_Rect rect;
rect.x = x;
rect.y = y;
SDL_QueryTexture(tex, NULL, NULL, &rect.w, &rect.h);
SDL_Point point = { 0, 0 };
SDL_RenderCopyEx(ren, tex, NULL, &rect, 90, &point, SDL_FLIP_NONE);
SDL_DestroyTexture(tex);
}
看过了,这个函数调用多了之后画面就卡的不要不要的,让我怎么输出一个屏的文字啊……求教!@不知者来此
2017年02月18日 01点02分
1
void PrintTTF(char* ch, int x, int y, int FontSize, SDL_Color Color)
{
font = TTF_OpenFont("font.ttf", FontSize);
sur = TTF_RenderUTF8_Solid(font, ch, Color);
TTF_CloseFont(font);
tex = SDL_CreateTextureFromSurface(ren, sur);
SDL_FreeSurface(sur);
SDL_Rect rect;
rect.x = x;
rect.y = y;
SDL_QueryTexture(tex, NULL, NULL, &rect.w, &rect.h);
SDL_Point point = { 0, 0 };
SDL_RenderCopyEx(ren, tex, NULL, &rect, 90, &point, SDL_FLIP_NONE);
SDL_DestroyTexture(tex);
}
看过了,这个函数调用多了之后画面就卡的不要不要的,让我怎么输出一个屏的文字啊……求教!@不知者来此