Sign in to follow this  

dx8 - dx9 conversion

This topic is 4106 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

i've just started learning game design and directx in particular and am trying to work from the now infamous book programming roleplay games... but am having major problems in getting stuff to work. after trying unsuccessfully to get it to work under dx8 i'm trying to convert it to dx9 and have managed to do most of the graphics core so far, but have the following question. in the code it throws up a compile error on ------------------------------- BOOL cFont::Begin() { if(m_Font == NULL) return FALSE; if(FAILED(m_Font->Begin())) return FALSE; return TRUE; } BOOL cFont::End() { if(m_Font == NULL) return FALSE; if(FAILED(m_Font->End())) return FALSE; return TRUE; } ------------------------------- resulting in -> no matching function for call to `ID3DXFont::Begin()' having checked through the sdk docs i noticed the begin() and end() methods have been removed but it doesn't say what they've been replaced with (or i can't find it). i would guess it would be DrawText(), if so, is it just a case of changing the code to m_Font->DrawText() and removing the end() stuff? or am i hoping for too much and its a lot more than that?

Share this post


Link to post
Share on other sites
Yea, you don't need to call ID3DXFont::Begin()/End() anymore - just call DrawText() right away. Just make sure that you are inside the global IDirect3DDevice9::BeginScene()/EndScene() pair and you should be good.

Share this post


Link to post
Share on other sites
The font::print method has the drawtext() method in the form of

if(FAILED(m_Font->DrawText(Text, -1, &Rect, Format, Color)))


so what you're saying is i can safely comment out the 2 checks on begin() and end() and all should be good?

Share this post


Link to post
Share on other sites
ok, i think i have that bit worked out, and have now come up to another error a bit lower down which i have no clue about, being a 2-day n00b when it comes to directx.

// Generate default mesh (if contains a skin mesh)
if((Mesh = m_Meshes) != NULL) {
while(Mesh != NULL) {
if(Mesh->m_SkinMesh != NULL) {
Matrix = new D3DXMATRIX[Mesh->m_NumBones];
for(i=0;i<Mesh->m_NumBones;i++)
D3DXMatrixIdentity(&Matrix[i]);
Mesh->m_SkinMesh->UpdateSkinnedMesh(Matrix, Mesh->m_Mesh);
delete [] Matrix;
}
Mesh = Mesh->m_Next;
}
}


The problem comes from the line:
Mesh->m_SkinMesh->UpdateSkinnedMesh(Matrix, Mesh->m_Mesh);

with this line providing 2 arguments, and the dx9 version of updateskinnedmesh taking 4 arguments, but i have no clue what the other 2 arguments i need are, or how to get them. Can anyone help?

Share this post


Link to post
Share on other sites

This topic is 4106 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this