Glad you got it working :)
Quote:Original post by speciesUnknown
Quote:1. You don't need the semicolons after the closing brackets of your function definitions.
this is a stylistic thing that a couple of people already told me off for. I guess ill change my habits.
Yeah, while some 'style' issues really are subjective, this one's pretty cut and dry.. It's basically equivalent to ending every sentence with two periods, which most would consider to be simply incorrect, rather than being a stylistic choice..
Quote:Quote:2. As far as I know, there's no need to define your header guard macros 'as' anything; you can just write '#define some_header_h'.
hmm, thats just a habit. I started off believing that the define would contain junk data so I set it to 1. Am I wrong on this belief?
Maybe someone else can confirm exactly how the preprocessor works in this respect, but I think if you leave a #define 'empty', then it's just 'empty'. It's defined, but if you were to actually try to use it somewhere, the preprocessor would just replace it with nothing. (In other words, #define's are just text substitution; they're not like variables, and don't really have a 'value' that will be undefined it they're not 'initialized'.)
Quote:Quote:3. Just out of curiosity, why are you including physics_cube.h in physics_object.h?
this is only my second use of inheritance, and I don't know of another way to get it working. The first time I did this I got strange "multiple definitions" errors, so I included the headers of the subclasses in the header of teh superclass, and it started to work.
I'm not sure what problems you were running into you, but you shouldn't have to do this (in general, you should also avoid placing code outside of the include guards). If I were you, I'd get those extra includes out of there and then just fix whatever problems come up (with help from your fellow GDNet'ers if necessary :).