DrawPrimitiveUP unexpected behavior

Started by
3 comments, last by Burnt_Fyr 13 years, 5 months ago
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?
Advertisement
According to the docs, the only effect is set stream 0 source to NULL.

Does the Debug Runtime provide any useful info?

Are you setting the FVF?

Please don't PM me with questions. Post them in the forums for everyone's benefit, and I can embarrass myself publicly.

You don't forget how to play when you grow old; you grow old when you forget how to play.

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! :)
Per Ron White (comedian): "You can't fix stupid." [smile]

Glad you found the problem.

Please don't PM me with questions. Post them in the forums for everyone's benefit, and I can embarrass myself publicly.

You don't forget how to play when you grow old; you grow old when you forget how to play.

~ 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

This topic is closed to new replies.

Advertisement