Jump to content

  • Log In with Google      Sign In   
  • Create Account


Troubleshooting an error learning GUI


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
3 replies to this topic

#1 QwertyKey   Members   -  Reputation: 122

Like
0Likes
Like

Posted 03 July 2011 - 07:40 AM

So, I am following this tutorial: http://lazyfoo.net/S...on01/index2.php

What happens is that it loads up the screen, but it's black and when it closes I get a big debug page. I have added the picture "clowns.jpeg" into the same directory as the application. From what I can tell the debug message isn't a problem, but I still am not actually getting it to display an image. Can someone help me figure out what is wrong?

This is the debug message:

'SDL_tutorial.exe': Loaded 'C:\Users\Ishan Mukherjee\Documents\Visual Studio 2010\Projects\SDL_tutorial\Debug\SDL_tutorial.exe', Symbols loaded.
'SDL_tutorial.exe': Loaded 'C:\Windows\SysWOW64\ntdll.dll', Cannot find or open the PDB file
'SDL_tutorial.exe': Loaded 'C:\Windows\SysWOW64\kernel32.dll', Cannot find or open the PDB file
'SDL_tutorial.exe': Loaded 'C:\Windows\SysWOW64\KernelBase.dll', Cannot find or open the PDB file
'SDL_tutorial.exe': Loaded 'C:\Users\Ishan Mukherjee\Documents\Visual Studio 2010\Projects\SDL_tutorial\Debug\SDL.dll', Binary was not built with debug information.
'SDL_tutorial.exe': Loaded 'C:\Windows\SysWOW64\advapi32.dll', Cannot find or open the PDB file
'SDL_tutorial.exe': Loaded 'C:\Windows\SysWOW64\msvcrt.dll', Cannot find or open the PDB file
'SDL_tutorial.exe': Loaded 'C:\Windows\SysWOW64\sechost.dll', Cannot find or open the PDB file
'SDL_tutorial.exe': Loaded 'C:\Windows\SysWOW64\rpcrt4.dll', Cannot find or open the PDB file
'SDL_tutorial.exe': Loaded 'C:\Windows\SysWOW64\sspicli.dll', Cannot find or open the PDB file
'SDL_tutorial.exe': Loaded 'C:\Windows\SysWOW64\cryptbase.dll', Cannot find or open the PDB file
'SDL_tutorial.exe': Loaded 'C:\Windows\SysWOW64\gdi32.dll', Cannot find or open the PDB file
'SDL_tutorial.exe': Loaded 'C:\Windows\SysWOW64\user32.dll', Cannot find or open the PDB file
'SDL_tutorial.exe': Loaded 'C:\Windows\SysWOW64\lpk.dll', Cannot find or open the PDB file
'SDL_tutorial.exe': Loaded 'C:\Windows\SysWOW64\usp10.dll', Cannot find or open the PDB file
'SDL_tutorial.exe': Loaded 'C:\Windows\SysWOW64\winmm.dll', Cannot find or open the PDB file
'SDL_tutorial.exe': Loaded 'C:\Windows\SysWOW64\msvcr100.dll', Symbols loaded.
'SDL_tutorial.exe': Loaded 'C:\Windows\SysWOW64\imm32.dll', Cannot find or open the PDB file
'SDL_tutorial.exe': Loaded 'C:\Windows\SysWOW64\msctf.dll', Cannot find or open the PDB file
'SDL_tutorial.exe': Loaded 'C:\Windows\SysWOW64\ddraw.dll', Cannot find or open the PDB file
'SDL_tutorial.exe': Loaded 'C:\Windows\SysWOW64\dciman32.dll', Cannot find or open the PDB file
'SDL_tutorial.exe': Loaded 'C:\Windows\SysWOW64\setupapi.dll', Cannot find or open the PDB file
'SDL_tutorial.exe': Loaded 'C:\Windows\SysWOW64\cfgmgr32.dll', Cannot find or open the PDB file
'SDL_tutorial.exe': Loaded 'C:\Windows\SysWOW64\oleaut32.dll', Cannot find or open the PDB file
'SDL_tutorial.exe': Loaded 'C:\Windows\SysWOW64\ole32.dll', Cannot find or open the PDB file
'SDL_tutorial.exe': Loaded 'C:\Windows\SysWOW64\devobj.dll', Cannot find or open the PDB file
'SDL_tutorial.exe': Loaded 'C:\Windows\SysWOW64\dwmapi.dll', Cannot find or open the PDB file
'SDL_tutorial.exe': Unloaded 'C:\Windows\SysWOW64\ddraw.dll'
'SDL_tutorial.exe': Unloaded 'C:\Windows\SysWOW64\dwmapi.dll'
'SDL_tutorial.exe': Unloaded 'C:\Windows\SysWOW64\setupapi.dll'
'SDL_tutorial.exe': Unloaded 'C:\Windows\SysWOW64\devobj.dll'
'SDL_tutorial.exe': Unloaded 'C:\Windows\SysWOW64\oleaut32.dll'
'SDL_tutorial.exe': Unloaded 'C:\Windows\SysWOW64\ole32.dll'
'SDL_tutorial.exe': Unloaded 'C:\Windows\SysWOW64\cfgmgr32.dll'
'SDL_tutorial.exe': Unloaded 'C:\Windows\SysWOW64\dciman32.dll'
'SDL_tutorial.exe': Loaded 'C:\Windows\SysWOW64\uxtheme.dll', Cannot find or open the PDB file
'SDL_tutorial.exe': Loaded 'C:\Windows\SysWOW64\dwmapi.dll', Cannot find or open the PDB file
'SDL_tutorial.exe': Loaded 'C:\Windows\SysWOW64\KBDUS.DLL', Cannot find or open the PDB file
'SDL_tutorial.exe': Unloaded 'C:\Windows\SysWOW64\KBDUS.DLL'
'SDL_tutorial.exe': Loaded 'C:\Windows\SysWOW64\KBDUS.DLL', Cannot find or open the PDB file
'SDL_tutorial.exe': Unloaded 'C:\Windows\SysWOW64\KBDUS.DLL'
'SDL_tutorial.exe': Loaded 'C:\Windows\SysWOW64\dsound.dll', Cannot find or open the PDB file
'SDL_tutorial.exe': Loaded 'C:\Windows\SysWOW64\ole32.dll', Cannot find or open the PDB file
'SDL_tutorial.exe': Loaded 'C:\Windows\SysWOW64\powrprof.dll', Cannot find or open the PDB file
'SDL_tutorial.exe': Loaded 'C:\Windows\SysWOW64\setupapi.dll', Cannot find or open the PDB file
'SDL_tutorial.exe': Loaded 'C:\Windows\SysWOW64\cfgmgr32.dll', Cannot find or open the PDB file
'SDL_tutorial.exe': Loaded 'C:\Windows\SysWOW64\oleaut32.dll', Cannot find or open the PDB file
'SDL_tutorial.exe': Loaded 'C:\Windows\SysWOW64\devobj.dll', Cannot find or open the PDB file
'SDL_tutorial.exe': Loaded 'C:\Windows\SysWOW64\dinput.dll', Cannot find or open the PDB file
'SDL_tutorial.exe': Loaded 'C:\Windows\SysWOW64\hid.dll', Cannot find or open the PDB file
'SDL_tutorial.exe': Loaded 'C:\Windows\SysWOW64\wintrust.dll', Cannot find or open the PDB file
'SDL_tutorial.exe': Loaded 'C:\Windows\SysWOW64\crypt32.dll', Cannot find or open the PDB file
'SDL_tutorial.exe': Loaded 'C:\Windows\SysWOW64\msasn1.dll', Cannot find or open the PDB file
'SDL_tutorial.exe': Loaded 'C:\Windows\SysWOW64\clbcatq.dll', Cannot find or open the PDB file
The thread 'Win32 Thread' (0xf84) has exited with code 0 (0x0).
The thread 'Win32 Thread' (0xda8) has exited with code 0 (0x0).
The program '[3488] SDL_tutorial.exe: Native' has exited with code 0 (0x0).


This is my code:

#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( "clowns.jpeg" );
	//Apply image to screen 
	SDL_BlitSurface( hello, NULL, screen, NULL ); 
	
	//Update Screen 
	SDL_Flip( screen ); 
	
	//Pause 
	SDL_Delay( 5000 );
	
	//Free the loaded image 
	SDL_FreeSurface( hello ); 
	
	//Quit SDL 
	SDL_Quit(); 
	
	return 0; 
}


Sponsor:

#2 KazenoZ   Members   -  Reputation: 152

Like
1Likes
Like

Posted 03 July 2011 - 08:53 AM

You're using a .jpeg file with the BMP loading function, so it doesn't work.

Check the next tutorial here for a way to blit other types of images(Use IMG_Load()).

On a general note though, using .jpegs isn't advised in 2D games, as they are of less quality, are lossy and usually weigh more, the preferred image types are usually .PNGs and .BMPs.

Also, this probably should've gone in the alternative game libraries forum =P

#3 QwertyKey   Members   -  Reputation: 122

Like
0Likes
Like

Posted 03 July 2011 - 09:11 AM

Thanks.

I created a bmp image and it still isn't loading though.

Here is the line:

hello = SDL_LoadBMP( "yo" );


I also tried with yo.bmp. The picture called yo is in the same folder as application.

Edit: Nevermind. Silly issue. I got it. Thanks.

#4 KazenoZ   Members   -  Reputation: 152

Like
0Likes
Like

Posted 03 July 2011 - 11:02 AM

You should post your solution to it anyway, just for future reference =)




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS