Hey GameDev :)
Just a quick one today, I can't seem to figure out why this code:
#include <d3d9.h>
#include <d3dx9.h>
#pragma comment (lib, "d3d9.lib")
#pragma comment (lib, "d3dx9.lib")
class Player
{
private:
static D3DXVECTOR3 paddlePosition;
static RECT paddleTexture;
public:
static void Initialize(LPDIRECT3DDEVICE9* d3dDevice);
static void Draw(LPD3DXSPRITE sprite, LPDIRECT3DTEXTURE9* texture);
static void Update();
};
void Player::Initialize(LPDIRECT3DDEVICE9* d3dDevice)
{
paddlePosition = D3DXVECTOR3(0, 0, 0);
paddleTexture.bottom = 28;
paddleTexture.left = 0;
paddleTexture.right = 136;
paddleTexture.top = 0;
}
void Player::Draw(LPD3DXSPRITE sprite, LPDIRECT3DTEXTURE9* texture)
{
sprite->Draw(*texture, &paddleTexture, &D3DXVECTOR3(0, 0, 0), &paddlePosition, D3DCOLOR_ARGB(255, 255, 255, 255));
}
void Player::Update()
{
}
Feels like telling me this:
Error 1 error LNK2001: unresolved external symbol "private: static struct tagRECT Player::paddleTexture" (?paddleTexture@Player@@0UtagRECT@@A)
Error 2 error LNK2001: unresolved external symbol "private: static struct D3DXVECTOR3 Player::paddlePosition" (?paddlePosition@Player@@0UD3DXVECTOR3@@A)
Could I get one of you lovely people to help me out? :)