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?
DrawPrimitiveUP unexpected behavior
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?
Does the Debug Runtime provide any useful info?
Are you setting the FVF?
FIXED: BAH! Not using my regular Dev computer, d3d was using retail runtimes, switched and found the issue:
Thanks again Buck! :)
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! :)
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement