Jump to content
  • Advertisement
Sign in to follow this  
Stukey

[.net] Directx Visual Basic .net unsafe thread graphics form problem

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

In my project I have a startup form, which starts a thread which is supposed to basically run the game (including update graphics) problem is for initializing graphics I need to give it a target form and I get an unsafe thread exception for using the form on a thread it was not declared in. I'm under the impression that this is a good thing and I shouldn't just toss the exception, or is that wrong because directx shouldn't affect any part of the form that would cause problems? Is there an easier way to fix this than move the graphics code into the form? If I do that then all of the objects the graphics renders will be based on cross thread reads and therefore a pain.

Share this post


Link to post
Share on other sites
Advertisement
Hmm, thanks, I actually used that tutorial to do my custom console, and I didn't think it could fix the problem I had because the exception was occuring on the line

d3dPP.DeviceWindow = target_form

but that was somehow incorrect because the problem was that my function for hiding the Panel for login controls was throwing the error and after I fixed the hide line the line I showed stopped throwing and exception too.

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!