Original Post
Greetings, I am trying to build a game, a 2d game, very simple and now I wanted to create a new class as I did.
#ifndef _H_Extras_
#define _H_Extras_
#include "Sprite.h"
enum COR
{
VERMELHO = 0,
ROSA = 1,
AZUL = 2,
AMARELO = 3
};
static int g_iTimer;
class Extras
{
public:
Extras();
~Extras();
bool Init( LPDIRECT3DDEVICE9 pd3dDevice );
void Draw( COR Cor, Sprite *m_kSprite );
private:
int MyTimer;
};
#endif
Now whenever I try to access to MyTimer when the game is trying to go there (running) it gives me an access violation, and I already have other 2 or 3 which I have no idea where they came from but it says on output. The error I am having is:
First-chance exception at 0x00403796 in Arkanoid.exe: 0xC0000005: Access violation reading location 0xbaadf00d.
Unhandled exception at 0x00403796 in Arkanoid.exe: 0xC0000005: Access violation reading location 0xbaadf00d.
The program '[440] Arkanoid.exe: Native' has exited with code 0 (0x0).
And I have no idea how to fix this, if anyone could help me I would be gratful.