SFML community forums

Help => General => Topic started by: FraktalZero on March 04, 2014, 05:21:54 am

Title: Newbie question
Post by: FraktalZero on March 04, 2014, 05:21:54 am
Hi!
I'm sorry for asking such a noob question but I've recently re-started learning C++ after several years, so I'm really out of it and trying to grasp the maximum. So I came across this and I'm simply trying to understand the logic behind it. So if anyone can point me in the right direction either with informational material or links it would be awesome.

So I'm trying to create a small game but using states (based myself in the small game engine provided by one user here except I can't remember his name) but instead of just copy and paste I want to recreate almost the same but by understanding how it works precisely.

My problem arises when trying to understand the InputManager in this case: I create an InputManager class
both .h and .ccp, but I would like to know how do I call this class in let's suppose the playstate window.

Do I simply include it in the header or do I have to go through other steps?

I'm sorry in advance if my question is too vague. If its the case I'll provide more information.

Thanks in advance!

Title: Re: Newbie question
Post by: Nexus on March 04, 2014, 09:16:14 am
You can include the header, then everything that's declared in the header becomes visible in the file where it's included. Now you can instantiate classes defined in the header, or call functions declared there.

Maybe it's a good idea to have a look at a good C++ book (http://stackoverflow.com/questions/388242/the-definitive-c-book-guide-and-list) :)

Please also choose a better thread title in the future.
Title: Re: Newbie question
Post by: FraktalZero on March 04, 2014, 06:49:42 pm
Thanks!
Thats very helpful :)

And Ill keep that in mind in the future.


Cheers