难道不能够这样 ,解决的办法是?
小弟多谢各位了~
代码: 全选
#include <SDL.h>
#include <SDL_ttf.h>
#include <SDL_thread.h>
SDL_Surface* disp;
TTF_Font* font;
SDL_Thread* thread;
SDL_Surface* text;
int proc( void * parm)
{
SDL_Color color = {255,255,255};
text = TTF_RenderText_Solid( font , "test" , color );
while(1);
}
int main()
{
SDL_Init(SDL_INIT_VIDEO);
TTF_Init();
disp = SDL_SetVideoMode(800,600,32,SDL_SWSURFACE);
font = TTF_OpenFont("font.ttf",15);
thread = SDL_CreateThread(proc ,NULL );
while(1)
{
if(text)
{
SDL_BlitSurface( text , NULL , disp , NULL );
text = NULL;
}
}
return 0;
}