1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79
|
#include*<stdlib.h>
#include*<stdio.h>
#include*<SDL.h>
void*pause();
int*main(int*argc,*char**argv[])
{
****SDL_Surface**ecran*=*NULL,**imageDeFond*=*NULL,**MGMT*=*NULL;
****SDL_Rect*positionFond,*positionMGMT;
************positionFond.x*=**0;
************positionFond.y*=**0;
********positionMGMT.x*=**579/4;
********positionMGMT.y*=**579/2;
********SDL_Init(SDL_INIT_VIDEO);
********SDL_WM_SetIcon(SDL_LoadBMP("sdl_icone.bmp"),*NULL);
********ecran*=*SDL_SetVideoMode(579,*579,*24,*SDL_HWSURFACE);
****SDL_WM_SetCaption("Chargement*d'images*en*SDL",*NULL);
***
****imageDeFond*=*SDL_LoadBMP**("fondbizard.bmp");
********SDL_BlitSurface(imageDeFond,*NULL,*ecran,*&positionFond);
********MGMT*=*SDL_LoadBMP*("merde.bmp");
********SDL_SetColorKey(MGMT,*SDL_SRCCOLORKEY,*SDL_MapRGB(MGMT->format,255,255,255));
********SDL_BlitSurface(MGMT,*NULL,*ecran,*&positionMGMT);
********
********
********SDL_Flip(ecran);
********pause();
********SDL_FreeSurface(imageDeFond);
********SDL_FreeSurface(MGMT);
********SDL_Quit;*
****return*EXIT_SUCCESS;
}
void*pause()
********{
****int*continuer*=*1;
****SDL_Event*event;
*
****while*(continuer)
****{
********SDL_WaitEvent(&event);
********switch(event.type)
********{
************case*SDL_QUIT:
****************continuer*=*0;
********}
****}
}
while*()
{
****SDL_WaitEvent(&event);
****switch(event.type)
****{
********case*SDL_QUIT:
************continuer*=*0;
************break;
********case*SDL_KEYDOWN:
************switch*(event.key.keysym.sym)
************{
****************case*SDLK_ESCAPE:*/**Appui*sur*la*touche*Echap,*on*arrête*le*programme**/
********************continuer*=*0;
********************break;
************}
************break;
****}
} |
Partager