Archived

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

Zefrieg

DAMN THESE VERTEX BUFFERS!

Recommended Posts

How utterly lame. DirectX would not render any of my vertices types that I created. Guess why? Just because there was a virtual destructor in the class/struct. Any idea why this is like this?

Share this post


Link to post
Share on other sites
And you passed the pointer to the object, instead the pointer to the data? Guess what, DX didn''t know what to do with the pointer to your vtable!

Share this post


Link to post
Share on other sites
VolkerG is spot on... a class with at least one virtual function has an internal pointer (in most compilers, it''s in offset 0 from the object''s address is memory) that points to the ''virtual table'' of methods of this object. You can read more about this in MSDN I guess.

Anyway, this is just a pointer, so it''s 32 bits long in Win32. Try outputing sizeof(myclass) with and without the virtual method, and you''ll see what I mean...

Share this post


Link to post
Share on other sites
Yes. I''m sorry Zefrieg. I just get upset sometimes, when someone blames others, before searching for the problem himself. However, nevermind ;-)

- Mete

Share this post


Link to post
Share on other sites
I agree with Mete, before blaming something or someone, 90% of the time it is your code doing the problem.

BTW,

Milkshape is the BEST $25 I have ever spent!

Techlead
www.myran.com/enilno

Share this post


Link to post
Share on other sites
I see that some of you people have emotional problems. I was just pointing out that such a simple thing to fix was giving me problems.

I apologize for not memorizing every little detail about C++ and virtual functions. Though, I cannot apologize for the rudeness of others when it comes to their ill temperament. It is disturbing to find people that become so aggressive about logical errors and mistakes. Though, I am not without pity. Even though some people have mastered the semantics of a language, I understand that it doesn''t mean they can communicate it properly.

Share this post


Link to post
Share on other sites
Zefrieg: you are right.

RhoneRanger: thank you! MS3D is my favorite project and I like it very much :-)

- Mete

Share this post


Link to post
Share on other sites