I have a problem when trying to load a mesh....well actually i split my project into seperate files i mada a file called Player.cpp a nd Player.h and i wrote an class called Player which i intended to be just a very simple class with basic functions
Heres Player.cpp
#ifndef PLAYER_H_INCLUDED
#define PLAYER_H_INCLUDED
class Player
{
public:
void loadPlayer();
};
#endif // PLAYER_H_INCLUDED
so i wrote in my main() Player object;object.loadPlayer();
and it all complied fine but when i run the program when it comes to the part where i call the function i get and error and its sttops runing.
Its very likely that i made some terible mistake in the code because its the first time i used OOP in my project and i always put everything in one file so excuse me if thats the case
@entety-I dont understant you i am not declaring another one just when i use smgr and get it out of device i need to declare the device in that file soo the complier could understand what device means(but thats most likely not the way its done so i get an error)anyway thanks for your help..And you re right i need to polish my C++ skilles
@RandomMesh-Thanks a lot ...And i do understand more then one line of code acctually four lines(Just kidding )Like i said i m still in the procces of learning and i read and did some basic exeples on OOP and i thing i understood some basic consteps and now i m trying to do some more practise with Irrlicht..So thanks once again(were usefull)
Ou yeah and just one other thing what does inline mean?
Last edited by Debeli on Mon Apr 12, 2010 5:24 pm, edited 1 time in total.
If you want to use device in other funcs then the main, then make it global(yes, I know, globals are evil, but what is the chance that he will declare another variable with name device?)
To make it global, just declare it before main like IrllichtDevice* device and then do that createDevice stuff somewhere in the beginning of main
@entity reading your post i just figure out how stupid i really am about a week a go im reading about globals and that they can be used throught diffrent filles in my project and why there are eveil, and then in this stupid case i frogot all about it