Jump to content
  • Advertisement

Archived

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

jitspoe

Verts in a class -- why isn't this working?

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

Ok, just trying to do some really simple things to get a feel for DirectX. I''m going through the NeXe examples. Maybe I''m just doing something stupid, but why does this work:
CVertex vtxTriangle[3];
...
g_pDevice->DrawPrimitiveUP(D3DPT_TRIANGLELIST, 1, vtxTriangle, sizeof(CVertex)); 
And this not?
class CTriangle
{
public:
	CVertex verts[3];
};
CTriangle triangle;
...
g_pDevice->DrawPrimitiveUP(D3DPT_TRIANGLELIST, 1, triangle.verts, sizeof(CVertex)); 
Everything is initialized the same way, and I put a breakpoint and checked the data with the VS debugger and it''s the same for both, yet with one I Get a triangle, and the other I get nil.

Share this post


Link to post
Share on other sites
Advertisement
Have you checked the return value of the DrawPrimitive call? Are you running the debug runtime? What does the debug spew say?

neneboricua

Share this post


Link to post
Share on other sites
I just checked -- it returns S_OK.

Are you referring to the ... gyah, nevermind. I was doing something stupid. lol. A 0.0 should have been a 1.0. I swear I looked over that several times, and I had a feeling it was something like that. Guess that''s what I get for coding at like 4am.

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!