Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Newbie question  (Read 865 times)

0 Members and 1 Guest are viewing this topic.

FraktalZero

  • Newbie
  • *
  • Posts: 2
    • View Profile
    • Email
Newbie question
« 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!


Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
Re: Newbie question
« Reply #1 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 :)

Please also choose a better thread title in the future.
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

FraktalZero

  • Newbie
  • *
  • Posts: 2
    • View Profile
    • Email
Re: Newbie question
« Reply #2 on: March 04, 2014, 06:49:42 pm »
Thanks!
Thats very helpful :)

And Ill keep that in mind in the future.


Cheers

 

anything