Hi there.
I've two classes. One has the member IrrlichtDevice *device.
How can the other class use this poiner?
I tried to give the second class this pointer in a parameter, but my compiler said, "Syntaxerror: 'IrrlichtDevice'" in every cpp File, which included the header of the second class
help me, please
Pointer problem
-
- Posts: 292
- Joined: Sun Mar 14, 2004 5:28 pm
- Location: Germany
- Contact:
Pointer problem
http://www.games-forge.de - Die Community für Nachwuchsprogrammierer
-
- Posts: 292
- Joined: Sun Mar 14, 2004 5:28 pm
- Location: Germany
- Contact:
I've got the feeling, it's a precompiler error:
You're right, I forgot the namespace, but this wasn't the problem.
Code: Select all
#include <stdio.h>
#include <Irrlicht.h>
using namespace irr;
using namespace video;
class CHeightMap
{
protected:
SHeightMapSize hmsSize;
CHeightPoint hpHeight[16];
public:
CHeightMap(void);
CHeightMap(FILE *HeightMapFile);
~CHeightMap(void);
bool init(FILE *HeightMapFile);
SHeightMapSize getSize(void);
void setSize(SHeightMapSize hmsSize);
CHeightPoint getHeight(int iIndex);
CHeightPoint getHeight(int iX, int iZ);
void drawAll(int iX, int iZ, IrrlichtDevice &device);
//void drawAll(IVideoDriver *driver);
};
http://www.games-forge.de - Die Community für Nachwuchsprogrammierer
-
- Posts: 292
- Joined: Sun Mar 14, 2004 5:28 pm
- Location: Germany
- Contact:
OK, I got it!
is wrong
is right
@schick:
I didn't post the compiler errors, because they're on german and i didn't know exactly how to translate.
Code: Select all
void drawAll(int iX, int iZ, IrrlichtDevice &device);
Code: Select all
void drawAll(int iX, int iZ, IrrlichtDevice *device);
@schick:
I didn't post the compiler errors, because they're on german and i didn't know exactly how to translate.
http://www.games-forge.de - Die Community für Nachwuchsprogrammierer
-
- Posts: 292
- Joined: Sun Mar 14, 2004 5:28 pm
- Location: Germany
- Contact: