Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


Trouble initializing D3D

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

Hello everyone, I''ve recently started learning Direct3D (Been using OpenGL for almost a year now). I''m having trouble setting up the vertices for a triangle. I''ve posted the code I''m using below, it''s almost cut and paste from the D3D tutorials in the DX7 Docs, yet it doesn''t compile worth a damn. //// Code //// int InitScene(void) { D3DVECTOR p1( 0.0f, 3.0f, 0.0f ); D3DVECTOR p2( 3.0f,-3.0f, 0.0f ); D3DVECTOR p3(-3.0f,-3.0f, 0.0f ); D3DVECTOR vNormal( 0.0f, 0.0f, 1.0f ); // Initialize the 3 vertices for the front of the triangle d3dvTriangle[0] = D3DVERTEX( p1, vNormal, 0, 0 ); d3dvTriangle[1] = D3DVERTEX( p2, vNormal, 0, 0 ); d3dvTriangle[2] = D3DVERTEX( p3, vNormal, 0, 0 ); // Initialize the 3 vertices for the back of the triangle d3dvTriangle[3] = D3DVERTEX( p1, -vNormal, 0, 0 ); d3dvTriangle[4] = D3DVERTEX( p3, -vNormal, 0, 0 ); d3dvTriangle[5] = D3DVERTEX( p2, -vNormal, 0, 0 ); return(1); }

Share this post

Link to post
Share on other sites
Presumably you are using the DX7 SDK and not DX8? That code won''t compile with the DX8 SDK. Plus I presume the d3dvTriangle[] array does exist? Plus you could check the vertex format matches with the primitive drawing calls and the d3dvTriangle[] array (x,y,z,ny,nz,tu,tv = D3DFVF_XYZ | D3DFVF_NORMAL | D3DFVF_TEX1 in DX7).

( Sorry for the patronizing questions )

If it''s none of those things then what compiler errors are you getting?

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!