Sign in to follow this  

(Hopefully trivial question) How do you make a red linelist show on a black bg?

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

So I have this wonderfully nice black texture, and am trying to contruct a rectangle (which is red) and have the rectangle show on top of it. However I can never see the color of the rectangle. Should I put it on a white/gray striped background I can see the red color nicely, however I cannot see the red rectangles when I use a black background. I setup my rectangle in a vertexbuffer and draw it as a primitive(linestrip):
hr = _device->SetStreamSource(0, vtx, 0, sizeof(CUSTOMVERTEX));		
hr = _device->SetFVF(D3DFVF_CUSTOMVERTEX);
hr = _device->DrawPrimitive( D3DPT_LINESTRIP, 0, 4);
The vertices are setup using D3DFVF_CUSTOMVERTEX=D3DFVF_XYZRHW|D3DFVF_DIFFUSE, and have the form of ( x, y, 0.0f(z), 1.0f(rhw), 0xffff0000 ). The background texture is black, setup as D3DFVF_XYZRHW|D3DFVF_TEX2, and have the form, ( x, y, 0.0f(z), 1.0f(rhw), tu, tv, tu1, tv1 ). Any ideas why the rectangles will not render on top of the black as red colored boxes?

Share this post


Link to post
Share on other sites
Programmer 16: Yeah I changed z coords, no luck unfortunately :(


Marmin:
My render is as such:

I clear, then render the texture.

Then I render the rectangles and set the FVF, so it comes at the end of the rendering loop.

I setup my customvertex to be of size 5( 0...4 ) so I have 5 line segments which forms a rectangle, which are in clockwise order as they should be. If thats not enough info please let me know.

Share this post


Link to post
Share on other sites
Wow that seems to me odd behavior... but I could just be crazy :)

Anyway, thanks! That worked well (now hopefully will work equally as well on a NVidia card), but thanks for the tip!

Share this post


Link to post
Share on other sites

This topic is 4562 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.

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