我正在尝试制作一个文本框,所以我使这个功能在屏幕上显示文字,
我有一个fps调节器,所以该功能每秒调用33次。
我有一台旧电脑(64 mb视频RAM和1 ram + Pentium 4 CPU 2.8GHz)
当我从我的代码中删除此函数时,它永远不会冻结,为什么?
MESSAGE(SDL_Surface * MESSAGE = NULL;)在我的代码顶部的include行下声明。 (SCREEN也是如此)
void text_box()
{
MESSAGE = TTF_RenderText_Solid( font, "Ligne #1" , noir );
apply_surface( 2, 503, MESSAGE, SCREEN );
SDL_FreeSurface(MESSAGE);
MESSAGE = TTF_RenderText_Solid( font, "Ligne #2" , noir );
apply_surface( 2, 510, MESSAGE, SCREEN );
SDL_FreeSurface(MESSAGE);
MESSAGE = TTF_RenderText_Solid( font, "Ligne #3" , noir );
apply_surface( 2, 517, MESSAGE, SCREEN );
SDL_FreeSurface(MESSAGE);
MESSAGE = TTF_RenderText_Solid( font, "Ligne #4" , noir );
apply_surface( 2, 524, MESSAGE, SCREEN );
SDL_FreeSurface(MESSAGE);
MESSAGE = TTF_RenderText_Solid( font, "Ligne #5" , noir );
apply_surface( 2, 531, MESSAGE, SCREEN );
SDL_FreeSurface(MESSAGE);
MESSAGE = TTF_RenderText_Solid( font, "Ligne #6" , noir );
apply_surface( 2, 538, MESSAGE, SCREEN );
SDL_FreeSurface(MESSAGE);
MESSAGE = TTF_RenderText_Solid( font, "Ligne #7" , noir );
apply_surface( 2, 545, MESSAGE, SCREEN );
SDL_FreeSurface(MESSAGE);
MESSAGE = TTF_RenderText_Solid( font, "Ligne #8" , noir );
apply_surface( 2, 552, MESSAGE, SCREEN );
SDL_FreeSurface(MESSAGE);
MESSAGE = TTF_RenderText_Solid( font, "Ligne #9" , noir );
apply_surface( 2, 559, MESSAGE, SCREEN );
SDL_FreeSurface(MESSAGE);
MESSAGE = TTF_RenderText_Solid( font, "Ligne #10" , noir );
apply_surface( 2, 566, MESSAGE, SCREEN );
SDL_FreeSurface(MESSAGE);
MESSAGE = TTF_RenderText_Solid( font, "Ligne #11" , noir );
apply_surface( 2, 574, MESSAGE, SCREEN );
SDL_FreeSurface(MESSAGE);
MESSAGE = TTF_RenderText_Solid( font, "Ligne #12" , noir );
apply_surface( 2, 581, MESSAGE, SCREEN );
SDL_FreeSurface(MESSAGE);
}