Visualisation Component & Sprite Class
My sprite class:
Code:
//sprite.h file
#include <HAPI_lib.h>
class CSprite
{
public:
CSprite(void);
~CSprite(void);
bool initialise ( const char *);
private:
BYTE *m_data;
int m_width;
int m_height;
};
//sprite.cpp file
#include ".\sprite.h"
#include <assert.h>
#include <HAPI_lib.h>
CSprite::CSprite(void)
{
*m_data = 0;
m_width = 0;
m_height = 0;
}
CSprite::~CSprite(void)
{
if (*m_data = 0)
delete[] *m_data;
}
bool CSprite::initialise (const char *textureFilename)
{
assert (textureFilename);
if (HAPI_LoadTexture (textureFilename, &m_data, &m_width, &m_height))
return false;
return true;
}
1. 'delete' cannot delete objects that are not pointers
__________________________________________________ _
NOTES:
- The program is written in C++, using Visual Studio 2003 as a Win32 project. The API is one designed by a university lecturer called HAPI.
- BYTE* m_data is supposed to be a pointer to my texture, which is loaded via the HAPI_LoadTexture function.
__________________________________________________ __
So does anybody have any idea on how i should rid my program of these errors? i have a visualisation class as well which has functions to Create and Draw sprites to the screen.