Jump to content
  • Advertisement
Sign in to follow this  
shvalb

problem displaying 3D shapes

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

Hi. I have a program that displays a 3D Cube. I have a class for the Cube that is being inherited from a base class (baseprimitive) which has all the VertexBuffer, IndexBuffer, Vertex struct array and another WORD variable for the indexs. LPDIRECT3DVERTEXBUFFER9 m_pVertexBuffer; LPDIRECT3DINDEXBUFFER9 m_pIndexBuffer; LPDIRECT3DTEXTURE9 m_pTexture; WORD m_cubeIndices[36]; // Holds the Indexes Vertex m_cubeVerticesValues[24];//array of struct for vertices If in the base class (baseprimitive) I explicitly declare the sizes of the Vertex struct and the WORD Index array (for a Cube 24/36) it works great! BUT if I declare them as pointers and allocate the memory (using 'new' operator) in the derived class it doesn't work, it does compile and no error when I debug it, but I see a black screen instead of a cube, any ideas why ??? ofcourse in the base class I do all the: CreateVertexBuffer(), CreateIndexBuffer() Lock(), memcpy() and Unlock(). Thanks!!

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • 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!