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 / Object not showing up.

Author
Message
Isocadia
15
Years of Service
User Offline
Joined: 24th Jul 2009
Location:
Posted: 24th Aug 2009 09:49
So, I have the most basic script, but I am trying to make it look neat so I am dividing it into different cpp files. But now, when i load my object in main.cpp it shows up, but when i use the same code in my PlayerProperties.cpp it does not show up. These are my code's:

Main.cpp:



PlayerProperties.cpp:



PlayerProperties.h:



Can someone tell me what I do wrong. I think I need to call the function CreatePlayer in main.cpp but don't know how.
Mista Wilson
16
Years of Service
User Offline
Joined: 27th Aug 2008
Location: Brisbane, Australia
Posted: 24th Aug 2009 12:57
Main.cpp has no idea that the other 2 files exist, and the other 2 files have no idea that each other exist either.

You need to use the pre-processor directive #include to include the files where they are needed.

I would suggest reading some tutorials on the web, a search on google for "C++ Tutorial" will get you a wealth of info. The problem is one that you would know how to solve yourself(or more than likely just wouldnt have) if you spent a little time learning the language before jumping into it. It is complex in some aspects, but well worth taking the time to learn properly.

To use an analagy, with absolutely no offence intended, trying to use c++ without first learning the language basics(which it really doesnt take too long to do), is similar to jumping into a swimming pool's deep end, with no idea of how to swim, you may not drown, but you will have a really hard time staying afloat...

If it ain't broke.... DONT FIX IT !!!
Isocadia
15
Years of Service
User Offline
Joined: 24th Jul 2009
Location:
Posted: 25th Aug 2009 19:43 Edited at: 25th Aug 2009 20:23
I did read C++ tutorials, the only thing that changed is that now I try to put my code in different files instead of one. And what you said worked, with a little help of the source of dark invaders i found out how to make it load correctly. So thank you very much.

Login to post a reply

Server time is: 2024-11-20 17:30:30
Your offset time is: 2024-11-20 17:30:30