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 / First GDK Tutorial -- Image only partially drawing?

Author
Message
Ghosted
16
Years of Service
User Offline
Joined: 9th May 2008
Location:
Posted: 9th May 2008 10:21
I'm relatively wet behind the ears, but I've been working on the first tutorial in the GDK folder; the Hello World tutorial to be exact. I'm pretty sure I've done everything right and I've followed pretty well, but where I'm supposed to be getting a blue background with a Earth with a text of "Hello World" around it after I load the image into the program, all I'm getting is the blue box.

I know that if I don't put anything into the code at all I don't even get that blue background, it's black - so I know that I effected it in some way, I just don't know if I'm only halfway correct in where I need the program to be, or it just turns blue if it has any input at all.



Pretty basic. I'm almost positive the code is right, and I put the PNG file in the right project directory in the right place, I'm almost positive. I just don't know what else could be out of place.

Thanks.
jinzai
18
Years of Service
User Offline
Joined: 19th Aug 2006
Location: USA
Posted: 9th May 2008 13:58
Would you try this slightly different version of your line that loads the image?

dbLoadImage ( "../animatedsprite.png", 1 );

Now, I think that is right, and will display correctly, too. The issue is that your executable program is not in the directory that you think it is. This is a result of how VS stores the executable, and can be fixed in a couple of ways.

I think the best way is to develop your code using the Release Build, and change the Linker/General/Output File option for the project. As it stands right now, it will be located in either the Release or Debug folder, and your png image is probably in the project directory...one directory above the executable.
Ghosted
16
Years of Service
User Offline
Joined: 9th May 2008
Location:
Posted: 9th May 2008 22:08
First off, thanks for your reply and your time to try to help me out. I know it can be frustrating helping someone with something over the internet in the first place.

Okay. I input your dbLoadImage ( "../animatedsprite.png", 1 ); string over my original dbLoadImage ( "animatedsprite.png", 1 ); string into the code, but nothing displayed; it actually just remained a black screen instead of turning blue like it did normally with the original code. Granted I left the png file where it was while doing this, though, but from what I understood I didn't need to move it or change any settings by using that string.

I couldn't find any options for a Output file folder or anything. I did stumble across an Import/Export option list but I wasn't sure that was the same thing.

I tried moving the .png file into the Debug folder, but the only thing that changed is that the window stayed black instead of changing to blue.

You said that I should develop my code using the release build -- am I not using that? I mean, as far as I know, I've not changed any settings and I'm using everything set to default.

Thanks again.

Login to post a reply

Server time is: 2024-10-07 23:26:15
Your offset time is: 2024-10-07 23:26:15