Sign in to follow this  

problem displaying 3D shapes

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

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