hmm, can anyone tell me whats wrong the below code
header
#ifndef UI_ITEM
#define UI_ITEM
#include "globalSettings.h"
#include "loadTexture.h"
class UI_item
{
public:
UI_item(float posx, float posy, float posz, float scalex, float scaley, float scalez,
IDirect3DVertexBuffer9* VB, IDirect3DIndexBuffer9* IB,
char *imageLocation );
~UI_item();
void display();
private:
D3DXMATRIX transform;
IDirect3DVertexBuffer9* VB;
IDirect3DIndexBuffer9* IB;
IDirect3DTexture9* image;
static std::vector <UI_item> UI_list;
};
#endif
cpp
#include "UI_Item.h"
extern IDirect3DDevice9* gd3dDevice;
std::vector <UI_item> UI_item::UI_list; //declare the static member
UI_item::UI_item(float posx, float posy, float posz, float scalex, float scaley, float scalez,
IDirect3DVertexBuffer9* _VB, IDirect3DIndexBuffer9* _IB,
char *imageLocation )
{
D3DXMATRIX statsWorld;
D3DXMATRIX statsScale;
D3DXMatrixIdentity(&statsWorld);
D3DXMatrixIdentity(&statsScale);
D3DXMatrixTranslation(&statsWorld, posx, posy, posz);
D3DXMatrixScaling(&statsScale, scalex, scaley, scalez);
transform = statsWorld * statsScale;
VB = _VB;
IB = _IB;
loadTexture(gd3dDevice, imageLocation, &image);
UI_list.push_back((*this));
}
UI_item::~UI_item()
{
}
void UI_item::display()
{
std::vector <UI_item>::iterator iter = UI_list.begin();
while (iter != UI_list.end())
{
gd3dDevice->SetTexture(0, iter->image);
gd3dDevice->SetTransform(D3DTS_WORLD, iter->&transform);
gd3dDevice->DrawIndexedPrimitive(D3DPT_TRIANGLELIST, 0, 0, 4, 0, 2);
iter++;
}
}
im getting the following error
1>d:\c++\my game\ui_item.cpp(37) : error C2059: syntax error : '&'
which points to this line
gd3dDevice->SetTransform(D3DTS_WORLD, iter->&transform);