Jump to content
  • Advertisement
Sign in to follow this  

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

This topic is 5137 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

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
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() ) )
// End the scene

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
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!