Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / Sprite not appearing

Author
Message
raWRcaLLiBer
13
Years of Service
User Offline
Joined: 5th Nov 2010
Location:
Posted: 16th Nov 2010 09:48
(this has happened on and off twice) So Icreate a miniature game with a seperate function for loading images called imageSetup() it contains both the loading of and placing of sprites using dbLoadSprite and dbSprite I include it in a header file I include it in my main loop compiles and runs, but when the application appears all is black no object or sprite has appeared. I gave up on that project unable to find a solution and started a new one, made new images loaded them IN the main loop not in a seperate function and they loaded and appeared fine, but about a week later i tried new images saved in the same format and they didnt load all was black

I save the images as a 24-bit bitmap (.bmp)
but the latest images that I used in the second project were
truecolour 24bpp (.bmp)

if any one has a solution would be much apreciated
Dodga
14
Years of Service
User Offline
Joined: 12th Dec 2009
Location:
Posted: 17th Nov 2010 00:12
Post your code and we can probably help you.
raWRcaLLiBer
13
Years of Service
User Offline
Joined: 5th Nov 2010
Location:
Posted: 17th Nov 2010 09:32

code for latest game just a test for a picture when I opened game it was black no wall

old game
ill split the function because its in two seperate files

function
main loop more after just not required
Mireben
15
Years of Service
User Offline
Joined: 5th Aug 2008
Location:
Posted: 18th Nov 2010 16:35 Edited at: 18th Nov 2010 16:36
The most probable reason for sprites not appearing is that the images that you load are not in the correct directory and the program does not find them, so they are not loaded at all.

If you don't give any path, and you run the program from Visual Studio (debug mode), then the images must be in the same directory as the cpp files.

When you compile in release mode and run the executable outside Visual Studio, then the images (again, if no path is given) must be in the same directory as the executable.

You can check with dbFileExist if the program finds the files.

Login to post a reply

Server time is: 2024-06-30 10:18:25
Your offset time is: 2024-06-30 10:18:25