It looks like everything is right to me, but nothing is showing up. Can anyone shed some light on my poor soul:
// VERTEX FORMAT ///////
typedef struct __declspec(dllexport) CUSTOMLINEVERTEX
{
float x,y,z;
D3DCOLOR color;
}CUSTOMLINEVERTEX;
#define CUSTOMLINEFVF D3DFVF_XYZ|D3DFVF_DIFFUSE
// Creating buffer////////
m_VertexBuffer = NULL;
ZDriver->GetDeviceCOM()->CreateVertexBuffer(4*sizeof(CUSTOMLINEVERTEX), 0, CUSTOMLINEFVF, D3DPOOL_DEFAULT, &m_VertexBuffer, 0);
// Setting up vertex///////
if( m_VertexBuffer == NULL )
return;
CUSTOMLINEVERTEX* pVertex;
m_VertexBuffer->Lock(0, 0, (void**)&pVertex, 0);
pVertex->x = 2.0f; //UPPER RIGHT CORNER
pVertex->y = 2.0f;
pVertex->z = 0.0f;
pVertex->color = m_Color;
pVertex++;
pVertex->x = 2.0f; //BOTTOM RIGHT CORNER
pVertex->y = -2.0f;
pVertex->z = 0.0f;
pVertex->color = m_Color;
pVertex++;
pVertex->x = -2.0f; //TOP LEFT CORNER
pVertex->y = 2.0f;
pVertex->z = 0.0f;
pVertex->color = m_Color;
pVertex++;
pVertex->x = -2.0f; //BOTTOM LEFT CORNER
pVertex->y = -2.0f;
pVertex->z = 0.0f;
pVertex->color = m_Color;
m_VertexBuffer->Unlock();
// RENDER LOOP //////
_Device->SetStreamSource(0, line->m_VertexBuffer, 0, sizeof(CUSTOMLINEVERTEX));
_Device->SetFVF(CUSTOMLINEFVF);
_Device->DrawPrimitive(D3DPT_TRIANGLESTRIP, 0, 2);
_Device->SetStreamSource(0, 0, 0, 0);
And that's about it, the world/proj/view matrices are set correctly btw, I have other stuff rendering this is the only thing that doesn't work. By a glance, does anyone see anything wrong with it? Any help will be greatly appreciated, thanks.
-Scar