Sign in to follow this  
Burnt_Fyr

DrawPrimitiveUP unexpected behavior

Recommended Posts

Burnt_Fyr    1665
While working on a textinput class for my ui system, I ran into a weird problem that i'm unable to solve. I was attempting to use DrawPrimitiveUP with a line list, custom vertex(position in screenspace, color). When the line is commented out the gui displays fine. However, when the line is activated, everything in my UI system is drawn black on black, IE invisible, except the Caret line and any Text that has been rendered. Pix is useless as it crashes when trying to view the mesh(not sure if this is related to using DrawPrimitiveUP or not). If I enter the game state and exit back to the menu everything is fine again, until i arrive at a screen with a textinput object, in which case the UI is back to black.

Question is: Does DrawPrimitiveUP set any renderstates/vertex declarations/vert/pixel shaders of it's own?

Share this post


Link to post
Share on other sites
Burnt_Fyr    1665
FIXED: BAH! Not using my regular Dev computer, d3d was using retail runtimes, switched and found the issue:


if(CurrentVertexDeclaration != buff->Decl) {
d3ddev->SetVertexDeclaration(buff->Decl);
CurrentVertexDeclaration = buff->Decl;

d3ddev->SetStreamSource(0,buff->VBuffer, 0, buff->Stride); // these lines should
d3ddev->SetIndices(buff->IBuffer); // exist outside this loop
}



Thanks again Buck! :)

Share this post


Link to post
Share on other sites
Burnt_Fyr    1665
~ Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. ~ Rich Cook

Share this post


Link to post
Share on other sites

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