Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I have a list of points for multiple lines. Each line could be hundreds of points long and there could be hundreds of lines. I would like to be able to change the colors of the lines and hide/show them instantly on mouse clicks. Becuase there are so many points to draw, the picture takes time to make.

 

My thought for the color and hide/show problem was to draw each line to its own surface. Copy them all to a backbuffer and then show that (after all the lines are on it) to the screen, the primary surface. This works for the most part. The only problem is that each surface has its background filled in so that only the most recently drawn line (the surface on top) is shown. I know this becuase I can click on the last line and it dissapears showing me another one, the one before/beneath it.

 

Two questions really.

1. How do I draw just the line on the surface and nothing else (so all lines will be visible when I copy all surface onto the backbuffer)?

2. What kind of memory issues does having many surfaces like this create? (this isn't really a problem, I'm just curious from a preformance standpoint)

 

Thank you very much.

Posted

Just make sure you have a surface with an alpha channel. Then when you clear the render target just set transparent color for background (I'm assuming you're rendering to surface).

 

Anyway a better way of doing this all would be to have a dynamic vertex buffer and streaming in only vertex data you need with correct colors.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...