bonjour,
je ne comprend pas du tout comment faire bouger une image dans SDL
voici mon code pour l´afficher:
- include < stdio.h>
- include < conio.h>
- include < stdlib.h>
- include < SDL/SDL.h>
SDL_Surface *screen;
SDL_Surface *image;
SDL_Surface *image2;
SDL_Event event;
int affichage(int,int,int,int);
int main(int argc, char *argv[])
{
bool done=false;
SDL_GetMouseState(&, &);
if(SDL_Init(SDL_INIT_VIDEO)<0)
{
printf("erreur");
getch();
exit(1);
}
atexit(SDL_Quit);
screen=SDL_SetVideoMode(640,480,16,SDL_HWSURFACE);
if(screen==NULL)
{
printf("erreur");
getch();
exit(1);
}
SDL_Rect dst;
dst.x=0;
dst.y=0;
dst.w=0;
dst.h=0;
image=SDL_LoadBMP("tuto.bmp");
SDL_BlitSurface(image,NULL,screen,NULL);
SDL_FreeSurface(image);
SDL_UpdateRect(screen,0,0,0,0);
while(!done)
{
while(SDL_PollEvent(&))
{
switch(event.type)
{
case SDL_QUIT:
done=true;
break;
}
}
}
return 0;
}
vous seriez gentil de me l´expliquez merci