Change Windows Application project to XNA project? - c#

Is there anyway to easily do this? Changing the Target framework or other properties doesn't work.

You can look for more clues in the XNA Windows game project template, found in this path:
VS_INSTALLDIR\Common7\IDE\VPDExpressExtensions\Microsoft\XNA Game Studio 4.0\ProjectTemplates\XNA Game Studio 4.0
Look for the Windows Game template called XnaWindowsGame-v4.0.zip
A simpler way may be creating a new Windows project, and a new XNA project, and comparing the .csproj files for both projects using a text editor (.csproj is nothing but a custom XML file).
I suspect the XNA project has a few extra tags in it specifying XNA related information, but in its essence it compiles to a Windows executable, so making these changes to the Windows .csproj file should "convert" it into an XNA project.

Related

Can't create C# Holographic project in Visual Studio 2019

I'm trying to start developing for the Hololens 2.
Instead of using Unity to create a 3D app, my intention is to create a "desktop app" with C#.
After installing the Windows Mixed Reality App Templates from the Microsoft Marketplace, I tried to create a C# project but VS gets stuck in the progress bar while creating the project and after several minutes displays the following message:
This issue is somewhat approached in this MS page: Creating a holographic DirectX project, in which it says:
If your holographic C# project didn't start from the Windows Holographic app template, you'll need to copy the ms.fxcompile.targets file from a Windows Mixed Reality C# template project and import it in your.csproj file to compile HLSL files that you add to your project.
It is clearly a known issue by Microsoft, but that's all there is to it.
Even with VS completely stuck, it does create the files for the project, and all the files mentioned above are present but i does not open properly.
What should I do to make the C# project work? Have anyone else faced this?
PS.: The C++ project template works fine.
Thanks.
When you say you want to create a "desktop app with C#", are you referring to a 2D app or a volumetric app?
2D apps are a breeze, you just create a regular UWP C# project [Blank (App Universal Windows)] and then build and deploy it for ARM64 to your HoloLens 2 and it will just work. No special templates required. Regular UWP apps that run on the desktop also run on the HoloLens. You can do a few things to optimize them for HoloLens and/or Windows Mixed Reality but you don't require any special templates.
See these links for more info:
Designing for Mixed Reality and
Building 2D Apps
If on the other hand you are trying to create a volumetric 3D experience in C# that involves DirectX there is a template in the Windows Mixed Reality templates that leverages SharpDX, look for the "Holographic DirectX11 App (Universal Windows)" the template without the "(C++/WinRT)" trailing text. It is a C# option that leverages the opensource SharpDX wrappers. There is mention of that option near the end of this "Creating a UWP project" section of the
Creating a holographic DirectX project page.

Xamarin-Monogame cross platform on Windows, using Visual Studio

I am trying to organize my Monogame project in a way which would simplify cross-platform targeting. However, since I am working on Windows, Xamarin Studio doesn't offer the "Monogame Universal App" or "Monogame/iOS" templates, but only templates for Shared projects and Android projects:
Xamarin Studio on Windows does not include iOS templates. Developers working on Windows need to add all code files to a project-specific Android project or manually add either a PCL or shared code project.
Since this is a Monogame project, I feel like most of the game logic and drawing should be abstracted through Monogame classes. But if I create a new Android solution in Xamarin studio, it creates a single project which contains the main Activity along with the Game class which references Mono.Android and OpenTK directly. Furthermore, included About*.txt files imply that I should be accessing resources through designer-built Resource class, which is tied directly to Android.
OTOH, if I create a "shared Monogame Xamarin project" in Xamarin Studio, it's completely empty (only a Game1 template class, but not even a reference to monogame, so it doesn't compile at all).
Is there a walkthrough/template for creating a shared Monogame project, with content which can be processed differently for each target platform?

How to use Xna Content Compiler on visual studio 2013

I saw this solution here so I downloaded and tried to run but I've never used XNA and the website from the link doesn't have any instruction/documentation...
Anyone who uses it have any suggestions?
(I don't have xna... I'm trying to use monogame)
Another rather classic solution is to install XNA framework included in Windows Phone SDK 7, create a separate XNA solution just for the purpose of building XNB files.
To get XNA working on your computer (for VS2010 - VS2013) first download Windows Phone SDK 7 and 8 (both of them) from here:
https://dev.windowsphone.com/en-us/downloadsdk
And then you can install XNA implementation for VS2010 - VS2013 from here:
https://msxna.codeplex.com/releases
Once all is installed, just create a new XNA Game solution. XNA will automatically create two projects for you, one of which is "Content" project, where you can place all your assets (pictures, sounds, fonts). After compilation you will get your XNB files created.

Can't add new monogame content project to solution in VS2012

I'm trying to add a new MonoGame content project (via templates installed in the MonoGame 3.0 installer) to an existing solution in Visual Studio 2012 (Professional), but it always comes up with the following dialog box:
It does create a few empty folders where the project should be, though they don't have anything in them. After this popup it also comes up with this:
I do not have XNA installed as VS2012 does not support it.
Also, I am using Windows 7.
Thank you!
If i were you I would read the three blog posts that Tara Walker has made about Windows 8 game development starting with this one: Overview, Installation and MonoGame 3.0.
The third blog post talks about creating a Content Pipeline outside of Mono Game (using XNA) and importing it into your MonoGame project. It sounds like you will need XNA so you'll need to read through her information and figure out how to get it working in VS2012 Express.
I've been dabbling with a MonoGame project in my spare time and I have been able to load some textures and sprite sheets without a dedicated content project; everything is just added to the project solution and created during initialization of the main class. But I don't know if this is viable in the long term.
HTH.
Mono Content Project depends on the XNA as MONOGAME is still working on truly independent CONTENT MANAGER. So as off now we have to intall XNA. Download it from XNA zip and unzip the content because XNA is not officially supported by MS.
Read the attached readme and install as mentioned. Don't forget to intal the file in zip folder named
"XNA Game Studio 4.0 (2012).vsix" which installs the "XNA" template for VS.
Now try to create a sub-project for your content. Your problem should be fixed !!

What's the difference between a Windows Game Library and a Class Library?

What's the difference between a Windows Game Library and a Class Library? Is it just that one starts off by including the XNA Framework?
Also, where are the differences between the Windows / Xbox360 / Zune Game Libraries? They all seem to start off with the same References (Microsoft.Xna.Framework, Microsoft.Xna.Framework.Game).
There is no real difference. It is just a project template, it helps you get all the project settings right. Yes, the assembly references are one of the biggies. I don't have it installed to check, but you can use, say, notepad to look at the .vcproj file to see what settings are overridden from their default.
I'm a bit late here with my answer, but the main difference between a Windows Game Library project and a simple Class Library project is that a Windows Game Library project can contain content references (they can build in content from referenced XNA "Content Project" projects).
Additionally, they can use XNA's project synchronisation (MSDN) to maintain copies of the project for different platforms, that keep their list of source files in sync.
Finally, these projects get an "XNA Game Studio" properties page, where you can select between the "Reach" and "HiDef" profile, and set a Game Thumbnail. Although these have no effect on libraries, as far as I know - they are only relevant for Game Projects.
XNA Game Projects have the same special features as Game Library Projects. They're just set to output an application instead of a library.
It's worth noting that you don't have to use these special "Game" versions of the project templates that XNA provides. You can still make an XNA game just by referencing the XNA assemblies. But obviously you won't have access to these nice project features, so you will need to come up with alternatives.

Categories

Resources