Sign in to follow this  
binpersonal

what is the best way to draw a 256 color colorbar?

Recommended Posts

Dear all, I want to draw a 256 color static colorbar on the screen, which is the best and fastest way to do that? Currently I create a texture, and use lock, unlock to copy the color, then display. Is there a better way to do that? I am thinking using the background of CDUXTDialog, but can not control the color freely. Anyone can give me better suggestions? Also, since it is a static colorbar, I don't want to update it every frame, where should I rend it? InitApp()? OnCreateDevice()? OnResetDevice()? Thank you very much!

Share this post


Link to post
Share on other sites
If it is truly static, i.e., you only create it once and it's not modified, creation speed doesn't really matter much. You can either create it as an image in Photoshop, or programmatically. If you create it in the managed pool, it'd be handled automatically during a reset, so you only need to create it once. I don't remember the DXUT structure without checking, so can't say if InitApp or OnCreateDevice is the right place, but I'm sure that looking at a sample would show were resources are created.

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