Aide SDL_TTF

Fermé
donaldro Messages postés 1 Date d'inscription vendredi 8 juillet 2016 Statut Membre Dernière intervention 8 juillet 2016 - 8 juil. 2016 à 11:06
Aidez-moi, s'il vous plaît ma ma fenêtre sdl disparaît quand je veux montrer le texte avec ttf j'ai fait tout les linker

voici le code :

#include <stdlib.h>
#include <stdio.h>
#include <SDL/SDL.h>
#include <SDL/SDL_image.h>
#include <SDL/SDL_ttf.h>
int main(int argc, char *argv[])
{
SDL_Surface *ecran = NULL, *texte = NULL, *fond = NULL;
SDL_Rect position;
SDL_Event event;
TTF_Font *police = NULL;
SDL_Color couleurNoire{0, 0, 0};
int continuer = 1;


SDL_Init(SDL_INIT_VIDEO);
TTF_Init();

ecran = SDL_SetVideoMode(640, 480, 32, SDL_HWSURFACE | SDL_DOUBLEBUF);
SDL_WM_SetCaption("Gestion du texte avec SDL_ttf", NULL);

fond = IMG_Load("moraira.jpg");

police = TTF_OpenFont("Arial", 10);
texte=TTF_RenderText_Blended(police,"coucou" ,couleurNoire);

while (continuer)
{
SDL_WaitEvent(&event);
switch(event.type)
{
case SDL_QUIT:
continuer = 0;
break;
}

SDL_FillRect(ecran, NULL, SDL_MapRGB(ecran->format, 255, 255, 255));



position.x = 60;
position.y = 370;
SDL_BlitSurface(texte, NULL, ecran, &position);
SDL_Flip(ecran);
}

TTF_CloseFont(police);
TTF_Quit();

SDL_FreeSurface(texte);
SDL_Quit();


return EXIT_SUCCESS;
}
s'il vous plaît quel est le problème?