Bonjour,
voici la source de mon programme:
#include <stdio.h>
#include <stdlib.h>
#include <SDL\SDL.h>
#define true 1
int main(int argc, char *argv[])
{
printf("\a");
if ( SDL_Init(SDL_INIT_AUDIO|SDL_INIT_VIDEO) < 0 ) { //Initialisation de SDL
fprintf(stderr, "\aImpossible d'initialiser SDL: %s\n", SDL_GetError());
exit(1);
}
atexit(SDL_Quit);
SDL_EnableUNICODE(1); //Activer l'unicode
SDL_Surface *screen; //Chargement du mode vid?o
while(true){
screen = SDL_SetVideoMode(640, 480, 16, SDL_SWSURFACE);
if ( screen == NULL ) {
fprintf(stderr, "\aImpossible de passer en 640x480 en 16 bpp: %s\n", SDL_GetError());
exit(1);
}
SDL_Event event;
SDL_WaitEvent(&event);
switch (event.type) {
case SDL_KEYDOWN:
printf("La touche %s a été préssée!\n", SDL_GetKeyName(event.key.keysym.sym));
break;
case SDL_QUIT:
exit(0);
}
}
return(0);
}//Fin de la boucle main()
Et la fonction printf(""); n'affiche aucun texte. Par exemple, l'instruction printf("\a"); au début du programme ne fait pas sonner le haut parleur de ma tour. Aussi printf("La touche %s a été préssée!\n", SDL_GetKeyName(event.key.keysym.sym)); il n'y a aucun texte qui s'affiche quand je tape une touche...
Pour compiler j'utilise minGW avec la commande:
gcc -o xcom.exe xcom.c -lmingw32 -lSDLmain -lSDL -mwindows
Peut-être ça vient de ça?
Aidez-moi c'est complètement chelou comme problème...
/*Acheter, Vendre, Echanger des cartes Yu-Gi-Oh! Jeu de Cartes à Jouer sur yugiohjcj.free.fr*/