Hi..
I have a question
I have a class that is handled on the main, and other class that is handled on bothj
So
I need to pass a pointer of the second class, to the first one.
Is this ok?
Ok. SO this is what I have
the first class:
[SOURCE]
class ManejaSup
{
public:
//Constructor
ManejaSup( SDL_Surface* pantalla );
//Destructor
~ManejaSup();
void DibujaSprite( Sprite* sprite );
};
[/SOURCE]
You can see that it takes a pointer to the Sprite class as a parameter.
Heres is the Sprite Class:
[SOURCE]
class Sprite
{
public:
//Constructor
Sprite( int ANCHO, int ALTO, int DIST, char* ARCHIVO, int COLUMNAS, int FILAS );
//Destructor
~Sprite();
SDL_Surface* imagen();
enum Direccion { IZQUIERDA, DERECHA };
Direccion dir;
bool bMover;
private:
SDL_Rect rctSprite;
SDL_Surface* sprite;
int Frame;
};
[/SOURCE]
So. in small words i need to call a function on One class that uses the parametrers of another clas..
Can iDo it?
I did it and I got this output:
c:\Juanu\Proyecto Juego\Engine_AnimaSprite\src\sprite.h(9): error C2011: 'Sprite' : 'class' type redefinition
What could it be??
Thanx!