loading textures with animations newbie
How can I load a animation in DirextX 8? Do I have to load all the textures from their own file. Or can i just load 1 file with all the textures included in that file.
Plz give a link from a tutorial or some exemple code
sorry for my bad English
gobelair
You do it how you''d like to do it.
If youre loading bitmap.. or similar then you need to load each one one by one.
-------
"Programming is like sex make one mistake, and you have to support it forever."
Homepage: www.ussshrike.com/pcwebvia/
If youre loading bitmap.. or similar then you need to load each one one by one.
-------
"Programming is like sex make one mistake, and you have to support it forever."
Homepage: www.ussshrike.com/pcwebvia/
thanks
but how can I load multiple Images from 1 file. Is there any tutorial for learning it? Or maybe some easy code.
but how can I load multiple Images from 1 file. Is there any tutorial for learning it? Or maybe some easy code.
You load one texture with all the frames of animation in it. Then set up a texture-rectangle matrix with a function like this
D3DXMATRIX DXGMatrixTextureRect(float Width,float Height,D3DRECT Rect);
{
D3DXMATRIX mOut;
D3DXMatrixIdentity(mOut);
mOut[0,0] = (1/Width)*Rect.x2;
mOut[1,1] = (1/Height)*Rect.y2;
mOut[3,0] = (1/Width)*Rect.x1;
mOut[3,1] = (1/Height)*Rect.y1;
return mOut;
};
Or something like that. It''s an excerpt from the D3D wrapper I''ll be releasing soon in DLL form.
void Signature()
{
Only for Delphi.
};
D3DXMATRIX DXGMatrixTextureRect(float Width,float Height,D3DRECT Rect);
{
D3DXMATRIX mOut;
D3DXMatrixIdentity(mOut);
mOut[0,0] = (1/Width)*Rect.x2;
mOut[1,1] = (1/Height)*Rect.y2;
mOut[3,0] = (1/Width)*Rect.x1;
mOut[3,1] = (1/Height)*Rect.y1;
return mOut;
};
Or something like that. It''s an excerpt from the D3D wrapper I''ll be releasing soon in DLL form.
void Signature()
{
Only for Delphi.
};
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement