Jump to content

  • Log In with Google      Sign In   
  • Create Account

#ActualDennisvb

Posted 01 March 2013 - 06:31 AM

Hello,

 

I started using SDL today and I am using this tutorial. I tried to run the program in the tutorial, but it just shows a black screen:

#include "SDL.h"

int main( int argc, char* args[] )
{
    // the images
	SDL_Surface *hello = NULL;
	SDL_Surface *screen = NULL;

	SDL_Init( SDL_INIT_EVERYTHING );

	screen = SDL_SetVideoMode( 640, 480, 32, SDL_SWSURFACE );

	hello = SDL_LoadBMP( "hello.bmp" );

	SDL_BlitSurface( screen, NULL, hello, NULL );

	SDL_Flip( screen );

	SDL_Delay( 2000 );

	SDL_FreeSurface( hello );

	return 0;
}

 

I placed the hello.bmp in the folder with the vsxproj file. What am I doing wrong?


#2Dennisvb

Posted 28 February 2013 - 11:26 AM

Hello,

 

I started using SDL today and I am using this tutorial. I tried to run the program in the tutorial, but it just shows a black screen:

#include "SDL.h"

int main( int argc, char* args[] )
{
    // the images
	SDL_Surface *hello = NULL;
	SDL_Surface *screen = NULL;

	SDL_Init( SDL_INIT_EVERYTHING );

	screen = SDL_SetVideoMode( 640, 480, 32, SDL_SWSURFACE );

	hello = SDL_LoadBMP( "hello.bmp" );

	SDL_BlitSurface( screen, NULL, hello, NULL );

	SDL_Flip( screen );

	SDL_Delay( 2000 );

	SDL_FreeSurface( hello );

	return 0;
}

 

I placed the hello.bmp in the folder with the vsxproj file. What am I doing wrong?


#1Dennisvb

Posted 28 February 2013 - 10:16 AM

Hello,

 

I started using SDL today and I am using this tutorial. I tried to run the program in the tutorial, but it just shows a black screen:

#include "SDL.h"

int main( int argc, char* args[] )
{
    // the images
	SDL_Surface *hello = NULL;
	SDL_Surface *screen = NULL;

	SDL_Init( SDL_INIT_EVERYTHING );

	screen = SDL_SetVideoMode( 640, 480, 32, SDL_SWSURFACE );

	hello = SDL_LoadBMP( "hello.bmp" );

	SDL_BlitSurface( screen, NULL, hello, NULL );

	SDL_Flip( screen );

	SDL_Delay( 2000 );

	SDL_FreeSurface( hello );

	return 0;
}

 

I placed the hello.bmp in the folder with the vsxproj file. What am I doing wrong?


PARTNERS