Sign in to follow this  

XNA control design

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

I've tried googling this over the last few days but haven't found anything definitive.

I want to create my own controls in XNA. I'm wondering if there is any way to get a GDI-like graphics object for a texture2D? I ask this because I need to be able draw lines, text and and various colors. If this is not directly possible how fast is the texture2D's setValue method? Is there some kind of optimized way I can access this data?

I don't mind getting low-level for this if possible.

I know I can use the GDI graphics object to draw my control to an image and then convert the image to a texture2D but I'm under the impression that this will be rather slow on most systems.


I am NOT targeting the XBox, windows phone or any system other then the PC.

Share this post


Link to post
Share on other sites
You can use SetData to update a texture, but it's not going to be particularly fast. D3D is optimized for sending rendering commands to the GPU that utilize GPU resources, not for having the CPU constant upload lots of texture data every frame. It might be fast enough for your needs...but that depends on what those needs are.

Share this post


Link to post
Share on other sites

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