Register    Login    Forum    Search    FAQ

Board index » Everything




Post new topic Reply to topic  [ 19 posts ]  Go to page Previous  1, 2
Author Message
 Post Posted: January 4th, 2018, 11:03 pm 
 

Joined: November 30th, 2013, 7:40 pm
Posts: 645
Location: Merville, British Columbia Canada
Quote:
Personally I think it's a bug that has been with VS for a while now. Sometimes I can make changes in headers and every .cpp file that includes that header is recompiled as it should. After a while of using VS or for some random reason, this behavior stops and I have to choose Rebuild instead of Build.

I get that problem as well.

_________________
Curiosity killed the cat, satisfaction brought him back


Top 
 Profile  
Reply with quote  
 Post Posted: January 5th, 2018, 1:09 am 
 

Joined: February 28th, 2013, 3:23 am
Posts: 2908
Location: Oklahoma, United States
Yeah, this is the main reason I like to use the CPP files, though I have been working on my SIMD and SIMD math library all in headers and so far only had that issue once.

_________________
If you think paging some data from disk into RAM is slow, try paging it into a simian cerebrum over a pair of optical nerves. - gameprogrammingpatterns.com


Top 
 Profile  
Reply with quote  
 Post Posted: January 5th, 2018, 2:17 am 
User avatar

Joined: May 23rd, 2013, 3:52 pm
Posts: 1240
Location: USA
That problem just has to do with the compiler seeing changes from the standpoint of the source files. If any source file that includes the header file is able to see the changes in it, then it would be recompiled properly.

_________________
always available, always on, about ~10 years c/c++, java[script], win32/directx api, [x]html/css/php/some asp/sql experience. (all self taught)
Knows English, Spanish and Japanese.
irc://irc.freenode.net/#pchili alt -- join up if ever want real-time help or to just chat :mrgreen: --


Top 
 Profile  
Reply with quote  
 Post Posted: January 5th, 2018, 5:06 am 
 

Joined: February 28th, 2013, 3:23 am
Posts: 2908
Location: Oklahoma, United States
Right, that's what should happen, but it doesn't always happen that way is what we're saying.

_________________
If you think paging some data from disk into RAM is slow, try paging it into a simian cerebrum over a pair of optical nerves. - gameprogrammingpatterns.com


Top 
 Profile  
Reply with quote  
 Post Posted: January 5th, 2018, 11:13 pm 
 

Joined: January 3rd, 2018, 7:44 pm
Posts: 7
Florian3321 wrote:
Hi there!
If I understand your problem, I think it happend due to that you only changed the values in the h file. If you then just build the project, because noting changed in the cpp file, the compiler does not make a new obj and does not link in a new exe, so the changes do not get into the game. If you rebuild, then the "new" h file gets it into the game, and the values are updated. On the one hand you can rebuild the solution or init the variable in the cpp file, not the h file. You can verify what I said if you compile your project, run it in the debugger and step into the constructor of game. If you get to the lines where the construction happens in the h file, Visual Studio tells you that the h file is different form the last build... I had the same problem and found that out, maybe it helps you:) What I do not unterstand is that it works if you build in release mode, maybe because VS rebuilds the project with optimizations?!


Thank you for that explanation. That clarified a lot. Actually it didn't work in release but did in debug. A implementation in the .cpp file worked. :-)

I did some work the last days and I am satisfied with my Invader clone. So thats my first game done :mrgreen: :mrgreen:
I realy learned a lot writing it! And I will take a leap of faith now and start a simple tower defence tomorrow. I think I will use SDL2 for that and hope that I am ready for that. If not I will do it with the ChiliFramework.
Anyway 1 done and so more to do :-) :!: :mrgreen:


Top 
 Profile  
Reply with quote  
 Post Posted: January 6th, 2018, 7:21 am 
 

Joined: February 28th, 2013, 3:23 am
Posts: 2908
Location: Oklahoma, United States
If you aren't fully commited to SDL2, I would suggest SFML. I found it easier to use and it's in C++ instead of C.

_________________
If you think paging some data from disk into RAM is slow, try paging it into a simian cerebrum over a pair of optical nerves. - gameprogrammingpatterns.com


Top 
 Profile  
Reply with quote  
 Post Posted: January 6th, 2018, 9:24 pm 
 

Joined: January 3rd, 2018, 7:44 pm
Posts: 7
albinopapa wrote:
If you aren't fully commited to SDL2, I would suggest SFML. I found it easier to use and it's in C++ instead of C.

Most discussions I read have a general sdl2>sfml mentality. I saw a good presentation for sdl2 on YouTube and with all the good comments about it I made the decision for it. But maybe it is worth to have a look at sfml too.

After I showed my space invaders to a friend I noticed that I forgot the ufo and I found a bug. So 1 extra day working on that one and then I'll start with the new.


Top 
 Profile  
Reply with quote  
 Post Posted: January 7th, 2018, 2:07 pm 
 

Joined: January 3rd, 2018, 7:44 pm
Posts: 7
So UFO is added bugs are fixed and my game is like I want it :-) So I am finished with my first game :mrgreen: :mrgreen: :mrgreen:
You can get the compiled Version here:
https://www.dropbox.com/s/auct23b0rofvoeo/Space-Invaders.rar?dl=0
And here is my code:
https://github.com/Neithari/Space-Invaders


Top 
 Profile  
Reply with quote  
 Post Posted: January 7th, 2018, 6:18 pm 
 

Joined: February 12th, 2017, 1:50 pm
Posts: 18
Congratulations! Looks really cool!


Top 
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
 
Post new topic Reply to topic  [ 19 posts ]  Go to page Previous  1, 2

Board index » Everything


 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
cron