Probleme SDL
dwyane346
Messages postés
156
Statut
Membre
-
dwyane346 Messages postés 156 Statut Membre -
dwyane346 Messages postés 156 Statut Membre -
Bonjour,
j ai configurer visual studio 2008 grace a ce tuto http://lazyfoo.net/SDL_tutorials/lesson01/windows/msvsnet0508e/index.php
le probleme est que mon programme compile normalement mais quand je charge une image elle n aparait jamais . il n y a juste qu une fenetre noir merci pour vos reponse .
ps voici mon main dailleur il n ya que sa dans mon programme
//Include SDL functions and datatypes
#include "SDL.h"
int main( int argc, char* args[] )
{
//The images
SDL_Surface* hello = NULL;
SDL_Surface* screen = NULL;
//Start SDL
SDL_Init( SDL_INIT_EVERYTHING );
//Set up screen
screen = SDL_SetVideoMode( 640, 480, 32, SDL_SWSURFACE );
//Load image
hello = SDL_LoadBMP( "hello.bmp" );
//Apply image to screen
SDL_BlitSurface( hello, NULL, screen, NULL );
//Update Screen
SDL_Flip( screen );
//Pause
SDL_Delay( 2000 );
//Free the loaded image
SDL_FreeSurface( hello );
//Quit SDL
SDL_Quit();
return 0;
}
j ai configurer visual studio 2008 grace a ce tuto http://lazyfoo.net/SDL_tutorials/lesson01/windows/msvsnet0508e/index.php
le probleme est que mon programme compile normalement mais quand je charge une image elle n aparait jamais . il n y a juste qu une fenetre noir merci pour vos reponse .
ps voici mon main dailleur il n ya que sa dans mon programme
//Include SDL functions and datatypes
#include "SDL.h"
int main( int argc, char* args[] )
{
//The images
SDL_Surface* hello = NULL;
SDL_Surface* screen = NULL;
//Start SDL
SDL_Init( SDL_INIT_EVERYTHING );
//Set up screen
screen = SDL_SetVideoMode( 640, 480, 32, SDL_SWSURFACE );
//Load image
hello = SDL_LoadBMP( "hello.bmp" );
//Apply image to screen
SDL_BlitSurface( hello, NULL, screen, NULL );
//Update Screen
SDL_Flip( screen );
//Pause
SDL_Delay( 2000 );
//Free the loaded image
SDL_FreeSurface( hello );
//Quit SDL
SDL_Quit();
return 0;
}
Configuration: Windows 7 / Google chrome core 2 duo E8500 carte ati3870 4go de ram ddr800 dd 500go
A voir également:
- Probleme SDL
- Installer SDL image 1.2.6 ✓ - Forum Programmation
- Sdl no available video device ✓ - Forum C
tu doit mettre la SDL_Rect avec,
SDL_BlitSurface(hello, NULL, screen, &pos_hello);
Comme ceci. :D