Jump to content
  • Advertisement
Sign in to follow this  
FenixRoA

XNA control design

This topic is 2703 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
Advertisement
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
Overall would you recommend just using a GDI image and transferring that into a texture? Or is there some way to just draw the GDI image on top of the XNA output?

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!