Sign in to follow this  
Johnny-aya

It's very strange with DX9(OCT 2004 update)

Recommended Posts

Johnny-aya    122
you know DX9 OCT 2004 UPDATE has an "DirectX Sample Browser" include many samples in it. and when you want to start a new programme it is very cool to use the "Emptyproject" in the browser. But I have some problem to this sample framework. When I install the "Emptyproject" and start new project, it's work fine with any HLSL programme. But I try to write some programme use the Fixed Function Pipeline, the problem out----there is nothing but buttons and text in the screen. Immediately,I closed all the vertex shader and pixel shader, I closed effect,too. but there is still nothing. So I use the other sample in the sample browser------"Text3D "beacause only this sample doesn't use any HLSL language in the programme.I add something such as: ID3DXMesh* g_pMesh; D3DXCreateSphere(pd3dDevcie,1.0f,50,50,&g_pMesh,0); g_pMesh->DrawSubset(0); It work fine! I don't know why I can't use the Fixed Function Pipeline in the "Emptyproject", did anybody go through this problem?? or dose anybody know what's wrong with me and how can I solve this problem?? tell me please... thx!

Share this post


Link to post
Share on other sites
tzuvich    122
Most of the other samples use shaders to control the rendering. The Text3D sample explicitly sets the rendering parameters with calls to the various pd3dDevice-> functions. You CAN use the fixed function pipeline in the EmptyProject sample, but you will need to convert it to make fixed function calls. As an example, you should be ok if you change the rendering lines to read:

D3DXMATRIXA16 matView = *g_Camera.GetViewMatrix();
D3DXMATRIXA16 matProj = *g_Camera.GetProjMatrix();
D3DXMATRIXA16 matViewProj = matView * matProj;

pd3dDevice->SetTransform( D3DTS_VIEW, &matView );
pd3dDevice->SetTransform( D3DTS_PROJECTION, &matProj );

// Clear the viewport
pd3dDevice->Clear( 0L, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0x00000000, 1.0f, 0L );

// Begin the scene
if( SUCCEEDED( pd3dDevice->BeginScene() ) )
{
g_pMesh->DrawSubset(0);
// End the scene
pd3dDevice->EndScene();
}

Note that you will also need to set up lighting and a material in this case.

Share this post


Link to post
Share on other sites

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