Buy dark basic pro if you haven't. It's the easiest by far and get the dreams of making console games out of your head unless you now what this means
LPDIRECT3DVERTEXBUFFER8 g_pVertexBuffer = NULL; // Vertices Buffer
LPDIRECT3DTEXTURE8 pTexture = NULL;
struct CUSTOMVERTEX
{
FLOAT x, y, z; // The transformed position for the vertex.
DWORD colour; // The vertex colour.
FLOAT tu, tv;
};
#define D3DFVF_CUSTOMVERTEX (D3DFVF_XYZ|D3DFVF_DIFFUSE|D3DFVF_TEX1)
void DrawTexturedTriangle()
{
VOID* pVertices;
//Store each point of the triangle together with it's colour
CUSTOMVERTEX cvVertices[] =
{
{ -1.0f, -1.0f, 0.0f, 0x00FF0000, 0.0f, 1.0f }, // x, y, z, color
{ -1.0f, 1.0f, 0.0f, 0x0000FF00, 0.0f, 0.0f },
{ 1.0f, 1.0f, 0.0f, 0x000000FF, 1.0f, 0.0f }
};
//FileName is "D:xfactordev.bmp"
D3DXCreateTextureFromFile(g_pD3DDevice, "D:xfactordev.bmp", &pTexture);
//Create the vertex buffer from our device
g_pD3DDevice->CreateVertexBuffer(3 * sizeof(CUSTOMVERTEX),
0,
D3DFVF_CUSTOMVERTEX,
D3DPOOL_DEFAULT,
&g_pVertexBuffer);
//Get a pointer to the vertex buffer vertices and lock the vertex buffer
g_pVertexBuffer->Lock(0, sizeof(cvVertices), (BYTE**)&pVertices, 0);
//Copy our stored vertices values into the vertex buffer
memcpy(pVertices, cvVertices, sizeof(cvVertices));
//Unlock the vertex buffer
g_pVertexBuffer->Unlock();
//Rendering our triangle
g_pD3DDevice->SetStreamSource(0, g_pVertexBuffer, sizeof(CUSTOMVERTEX));
g_pD3DDevice->SetVertexShader(D3DFVF_CUSTOMVERTEX);
//Set our background to use our texture buffer
g_pD3DDevice->SetTexture(0, pTexture);
g_pD3DDevice->DrawPrimitive(D3DPT_TRIANGLELIST, 0, 1);
g_pVertexBuffer->Release();
pTexture->Release();
}
All bow down to evil