Hey Guys!
I wonder how to put a texture on a specific position in DirectX.
for example: I want a function that allows to set a Texture on an 2D Position and set the width and height like this pseudo funktion:
x y w h
DrawTexture(pDevice, 25, 25, 200, 100);
Well, some Code:
LPDIRECT3DTEXTURE9 texture = NULL;
DWORD color = D3DCOLOR_XRGB(16, 16, 16);
const BYTE Image[64] = {color,color,color,color,color,color,color,color,
color,color,color,color,color,color,color,color,
color,color,color,color,color,color,color,color,
color,color,color,color,color,color,color,color,
color,color,color,color,color,color,color,color,
color,color,color,color,color,color,color,color,
color,color,color,color,color,color,color,color,
color,color,color,color,color,color,color,color};
void DrawTexture(LPDIRECT3DDEVICE9 pDevice, int x, int y, int w, int h){
D3DXCreateTextureFromFileInMemory(pDevice, &Image[64], sizeof(Image), &texture);
//Some Magic :(
pDevice->SetTexture(0, texture);
}
does someone has an idea?
Yours vedel