Alors... j´ai quelques soucis en Cpp.
J´ai essayé de faire un petit truc avec SDL mais je me suis apparemment planté et je sais pas où... et c´est ca le probleme. Le programme s´execute, maffiche une image noir et se ferme.
- include " SDL/SDL.h"
SDL_Surface* screen;
SDL_Surface* buff;
/ /Fin de declaration
void Initialisation()
{
SDL_Init(SDL_INIT_VIDEO);
screen = SDL_SetVideoMode ( 320, 240, 32,SDL_HWSURFACE|SDL_DOUBLEBUF|SDL_FULLSCREEN);
SDL_ShowCursor(0);
}
SDL_Rect Rect ( int x, int y, int w, int h)
{
SDL_Rect R;
R.x=x;
R.y=y;
R.w=w;
R.h=h;
return R;
}
SDL_Surface* Vram(char* fichier)
{
SDL_Surface* a;
SDL_Surface* b;
a = SDL_LoadBMP(fichier);
b = SDL_CreateRGBSurface(SDL_HWSURFACE, 320, 240, 32, 0, 0, 0, 0);
SDL_Rect R=Rect(0,0,a->w,a->h);
SDL_BlitSurface(a,NULL,b,&);
SDL_FreeSurface(a);
return b;
}
void test()
{
SDL_Surface* img=Vram("init.bmp");
SDL_Rect r=Rect(0, 0, 320, 240);
SDL_BlitSurface(img, NULL, buff, &);
SDL_BlitSurface(buff, NULL, screen, &);
SDL_Flip(screen);
for(int a ; a<1000 ; a++)
{int i = a;}
}
/ /fonction principale
int main ( int argc, char *argv[])
{
Initialisation();
test();
SDL_ShowCursor(1);
SDL_Quit ( );
return 0;//
}
2 autres petits trucs :
1) J´avais entendue parler d´un site pour heberger ses codes sources avec coloration syntaxique et je voudrais bien connaitre l´adresse
2)Merci a celui qui resoueras mon ( petit) probleme 