Sign in to follow this  

SDL isn't updating some variables.

This topic is 3733 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm not sure if it is SDL or Dev C++ that is doing this, but it is happening in SDL functions, so I thought this would be the best place for this. Anyways, I'm following this tutorial: http://lazyfoo.net/SDL_tutorials/index.php The problem I'm having is I'll set some numbers to something, compile and run it, then change the numbers but it doesn't really change when I recompile and run it. To be more specific, I combined the Text tutorial and Image loading tutorial from above into one. First, with the text part of my program, I set the textColor to { 255, 255, 255 }. So I compiled it and ran the program, and the text came out how it should. Then I changed the textColor to some kind of green. Well when I compiled the program and ran it again, the color didn't change. That was after a few hours of playing around with it, so I didn't care and just stopped. I came back later to program it some more, and after I added a little bit of code( not much really, and I didn't touch the textColor ) I recompiled and ran the program and the text changed into the green color, even though I didn't touch it. So I thought nothing of it and maybe my computer hi-cupped(sp?) or something and just forgot to load the new color >___> So just now when I added the image loading part, I set the image to load at 100, 100 ( using the above tutorials 'apply_surface' function ). I compiled and ran it, and it worked fine. Then since I had it working, I wanted to change where I put the image, so I changed it to be 30, 30. Well I recompiled it and ran it again, but the image didn't move. It was still at 100, 100. And just to say the functions so you guys know what I'm talking about: the one for the text color: textColor = { 0, 255, 255 ); the one for the image: apply_surface( 30, 30, image, screen, &clip[0] ); I could change the numbers in those functions, but it wouldn't change when I compiled it. I thought it would be fixed if I restarted Dev C++, but that didn't work. So is there a reason it isn't changing? I'm using the latest SDL version, and Dev C++ 4.9.9.2. Hopefully someone understands this and can help me. :)

Share this post


Link to post
Share on other sites
It sounds to me like you're not rebuilding the entire program when you make a change. Dev-C++ is not a very good IDE to be using anyway, and may be contributing to your problem by making it hard to see what's compiled properly. Microsoft offer free compilers and IDEs these days, and Code::Blocks is far better than Dev-C++ if you prefer the free software route.

Share this post


Link to post
Share on other sites
Ah alright thanks. I tried downloading Code::Blocks a while ago, but the links were broken, but they seem to be working right now, so I'll switch to that. Hopefully this will solve my problems, and thanks if it does!

Edit: Just wanted to say thanks again. I just downloaded Code::Blocks and I'm definitely liking it better than Dev C++, and the problem I had earlier isn't happening anymore =D

[Edited by - Protomin on September 18, 2007 2:43:47 PM]

Share this post


Link to post
Share on other sites
Quote:
Original post by Kylotan
Just as an aside, to get the best out of Code::Blocks, you may want to get the nightly builds from the forums, but that's a slightly involved process.


Seconded. The stable build of CB is crap. The nightly snapshots, though, are fairly decent (and at least better than dev-cpp).

Share this post


Link to post
Share on other sites
The nightly on code blocks is quite good now. All you have to do is download the most recent one and download any of the extra files into the directory where you should have extracted the build. Done. The auto configuration of compilers seems to work quite well also.

Share this post


Link to post
Share on other sites
Quote:
Original post by KylotanDev-C++ is not a very good IDE to be using anyway, and may be contributing to your problem by making it hard to see what's compiled properly.


Create a directory for .o files and check their time. If some module is not up to date, clean & rebuild the project. Or just clean and rebuild.

Share this post


Link to post
Share on other sites

This topic is 3733 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this