Jump to content
  • Advertisement
Sign in to follow this  
coldacid

[XNA] How do I determine the plaform on which I run?

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

So with XNA, how do I tell if I'm running on Windows or on the Xbox? There doesn't seem to be any information about this in the XNA documentation.

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by coldacid
So with XNA, how do I tell if I'm running on Windows or on the Xbox? There doesn't seem to be any information about this in the XNA documentation.

As of now, I'm not sure that there is (or if there is going to be one in the future). They seem to be keeping a pretty tight leash on doing platform-specific stuff. However, who knows how that could change, as all of that is still being developed.

Is there a way to do it based on the build configuration or something? In C++ you would just make a #define - I'm not what the alternate to that is in C# though.

Share this post


Link to post
Share on other sites
I think they had said that there would be a compile time define they would have you set for it, but I'm not sure about that.

Share this post


Link to post
Share on other sites
There's the System.Environment.OSVersion.Platform property you can get. Maybe running on the XBox will return a new value (one that's not listed in System.PlatformID)?

Share this post


Link to post
Share on other sites
Try posting this question on the official XNA forums, I know Mitch, Dave, and several others have been great at answering questions like these. Makes you wonder if they ever actually get any work done on the framework.

Share this post


Link to post
Share on other sites
From what I understand, you have to compile a different binary for each system anyways, so you can just put in your own conditional compilation flag.

http://msdn2.microsoft.com/en-us/library/yt3yck0x.aspx

And I think there's a way of making different build configurations automatically define things for you. I've never done that myself, but I seem to recall seeing it somewhere.

Share this post


Link to post
Share on other sites
It seems that is possible to run the same binary on every XNA platform.

A good indication to know the platform you run should be the supported shader profile. Only the XBox have they special Shader Mode 3 variant.

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!