Alors,alors,j´ai un soucis avec "args". Tout d´abord, je n´ai aucune idée de ce que représente "args", "argc" ou encore "argv", donc si quelqu´un peut me donner une idée de ce que c´est ce serait bien cool.
Mais le plus gros problème n´est pas la, j´ai une fonction qui devrait me permettre d´afficher du texte sous SDL et elle utilise "args".
Le probleme c´est que DevC++ me dit < `va_start´ used in function with fixed args >.Voila, je ne trouve aucune information sur "args", aidez moi s´il vous plait ;- )
ma fonction :
void PrintSDL(SDL_Surface* font,SDL_Surface* dest,int x,int y,char* text)
{
char buf[500];
int i;
int inx,iny;
int w,h;
va_list args;
va_start(args,text);
vsprintf(buf,text,args);
va_end(args);
w = font->w/16;
h = font->h/14;
for(i=0;i<(int)strlen(buf);i++)
{
inx=w*((unsigned char)(buf[i])%16);
iny=h*((unsigned char)(buf[i])/16-2);
if (iny-h>font->h)
return;
Blit(font,inx,iny,inx+w,iny+h,dest,x,y);
x+=w;
}
}
et Blit, la voici si elle peut vous etre utile :
void Blit(SDL_Surface* source,int x1,int y1,int x2,int y2,SDL_Surface* dest,int x3,int y3)
{
SDL_Rect S=Rect(x1,y1,x2-x1+1,y2-y1+1);
SDL_Rect D=Rect(x3,y3,0,0);
SDL_Rect* pS=&S;
if (x1<0)
pS=NULL;
SDL_BlitSurface(source,pS,dest,&D);
}
voila, voila, et merci à celui qui pourra m´aider.
inaperçut