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 / DarkSDK app entry point and classes question...

Author
Message
Lampton Worm
21
Years of Service
User Offline
Joined: 4th Sep 2002
Location: United Kingdom
Posted: 13th Aug 2005 20:04 Edited at: 13th Aug 2005 20:08
Hi,

Is it 'safe' to assume that any code inside...



...is essentially what would go in a usual C++ programs...



?

My overall layout at the moment is something like this...in one file -

1) includes
2) class definitions
3) void DarkSDK
3.0) typedefs, list objects, pointers etc.
3.1) My main loop etc.

...and I wondered if that is normal/ok. Perhaps typedefs etc. need to go after includes rather in 'inside' the DarkSDK loop?

Which then leads to my next question - in what order are classes, err, evaluated? For example, lets say I have a player class, and a playerbullet class, and the player class is 'friends' with the playerbullet class (because inside the player class it creates a playerbullet object when the player fires). All in the same .cpp, the player class is defined first, then the playerbullet class. But! The player class is told to be friends with playerbullet before playerbullet has been defined, so this results in a C2433 ('friend' not permitted on data declarations?).

[EDIT] if I call the new bullet code in the DarkSDK part as apposed to within the player class it works. But that defeats the point!

Any ideas or suggestions? p.s. if I move my typedefs etc. to after includes I have to have some dummy class definitions up there too, and the error changes to C2514 (class has no constructors), which is kinda more logical in that the player class is trying to construct an object using my dummy class def not the real one.

Cheers in advance
Lampton Worm
21
Years of Service
User Offline
Joined: 4th Sep 2002
Location: United Kingdom
Posted: 14th Aug 2005 00:33
Fyi, I sorted out the main issues I was having. I was sometimes calling a constructor in a class that hadn't yet been defined/declared. I did try to split various class out into relevant .h/.cpp but no joy yet (need to include DarkSDK.h at the top of each file so it seems and a few other errors from the SDK coming up), anyway, getting there Ta.
OSX Using Happy Dude
20
Years of Service
User Offline
Joined: 21st Aug 2003
Location: At home
Posted: 14th Aug 2005 15:45
Fair enough

AtomZ - its got an A. Its got a Z. Now its just needs U
Blog:http://spaces.msn.com/members/BouncyBrick/
Web Site:http://www.nicholaskingsley.co.uk
Lampton Worm
21
Years of Service
User Offline
Joined: 4th Sep 2002
Location: United Kingdom
Posted: 14th Aug 2005 17:58
I find the best way to solve a problem is to post it, then minutes later the answer comes to mind !!

Login to post a reply

Server time is: 2024-03-28 18:32:51
Your offset time is: 2024-03-28 18:32:51