Is it possible to code a Windows 8 RT and/or Windows 8 Phone game using C#?
I have done a fair amount of research on the "Games in C#" thing, so I thought I would post it for others:
XNA is an easy way to make a C# game. You can post a new XNA game on the Windows Store and it will work fine.
However, you cannot make a Windows Phone 8 or Windows 8 game using XNA. (You can only target version 7.1 of Windows Phone.) The new APIs for these operating systems are not supported in XNA.
However, both Windows Phone 8 and Windows 8 will run XNA apps. Those apps just cannot target any features that are specific to Windows 8 or Windows 8 Phone.
So to sum up. The current version of XNA (4.0) supports the older API to talk to Windows and Windows Phone. They can still run on Windows 8, but you can't use the newer stuff.
Microsoft does not have an offering to make games in C# for the new Windows 8 and Windows Phone 8 APIs.
However, if you don't mind using open source projects there are some things you can do to write a game in C# that can use the newer Windows 8 and Windows Phone 8 API:
MONOGAME
If you want to use XNA's api to make games for the new Windows 8 APIs you can use MonoGame (this is what I use). It is an open source api that implements the XNA API but has plugins for IOS, Android and Windows 8. This is a really good cross platform option. 3D graphics recently became supported by MonoGame(i.e. Infinite Flight, Armed). (Note: I am not affiliated with MonoGame in any way.)
SHARP DX (DirectX)
If you want a Microsoft Supported way to make a game that targets the Windows 8 API your best bet is DirectX. But Direct X is a C++ API. It is also really really hard.
If you are wanting to make a 2D game (like Plants vs Zombies or Angry Birds) then Direct X is overkill. You are far better off going the MonoGame route. I spent several days digging through tutorials and working very hard to understand Direct X. By the end of that time I was rewarded with the ability to draw a single triangle on the screen. (That same amount of time had my game loop going and sprites moving around in MonoGame.)
So I repeat, if you don't already know DirectX and you are making a 2D app, don't go down the DirectX/SharpDX road.
The DirectX 2D route is further hindered by Windows Phone 8 not supporting Direct2D. DirectX has a subset called Direct2D for 2D rendering. However, this subset is not supported on Windows Phone 8. The "replacement" (for now) is the Direct X toolkit.
If you are still all in with the Direct X road, then you can write it in C# using SharpDX. It is a C# wrapper for DirectX that works very well (though I don't know if it supports the Direct X Toolkit).
SUMMARY
The short of it (for me) is that Microsoft did not update their APIs for C# game development to support the new stuff in Windows 8 and Windows Phone 8. But MonoGame lets you use the XNA API to do just that. It also allows you to write cross platform games, so it is better anyway. (You get porting to IOS and Android for "Free".)
My game is well underway in MonoGame with no issues so far!
Related
Is it possible to create a video editor in C# by using DirectX or should I use a different SDK to make a video editor? Keep in mind that I need to be able to animate objects (shapes and paths like in After Effects if possible).
There are really two Windows APIs you should consider for a video editor:
Media Foundation which is the modern Windows media API for video and audio.
DirectShow which is an older technology that dates back to the late 90s.
The DirectX SDK is not applicable to video application development. DirectShow was pulled out of the DirectX SDK back in April 2005. Media Foundation never shipped in the DirectX SDK. See DirectX SDKs of a certain age.
Note that even the DirectX SDK itself is legacy these days. See MSDN
Instead, these APIs are available in the Windows SDK. If you are using Visual Studio, you likely already have a copy of this SDK. For a list of versions, see A Brief History of Windows SDKs
To make use of either of these APIs from C#, you should take a look at Media Foundation and directshow.net.
There is a Direct3D 11 Video technology that is part of the DirectX 11.1 Runtime (Windows 8 SDK or later). It is extremely low-level and is really intended for things like Media Foundation itself to use as a renderer with some ability to do GPU acceleration of the processing.
I need to rewrite a XNA app and deploy it on Window Phone 8/8.1.
My app requires extensive graphic presentation updated very frequently (kind of a game but not really) based on user's control. I am looking for an alternative API or framework so I can easily transfer the XNA code to the new platform (WP8/8.1).
Thanks.
You should look into MonoGame. It is an open source implementation of the XNA framework and it can be deployed on multiple platforms (including WP8).
Is OpenGL and OpenGL ES available for Windows 8 Store Application (want to run application in windows 8 pro tablet)?
and yes then it is available in C#?
(This above question is because i want chroma key composting "green screen" implement in windows 8 pro using OpenGL)
Microsoft Open Technologies are working on OpenGL ES support for Windows Store.
https://github.com/MSOpenTech/angle
It's written in C++.
Please find answer from here MSDN FORUMS
DirectX is available to Windows Store apps. OpenGL is not. How best to
perform a green screen will depend on what sort of green screen you
need. For advanced graphics you generally want DirectX, but for simple
static greenscreening you can access a WriteableBitmap's PixelBuffer
directly.
--Rob
Can I run RT apps on windows phone, or windows 8 phone apps on windows 8 RT or PRO?
If I need to develop an app to run on RT tablets and on windows 8 phones, what should I do?
EDIT
When Microsoft will provide a unified way to develop apps????
Am I requested to develop tons of apps to run on all of Microsoft platforms, I am not an Apple fan at all, but Microsoft should learn more and more from them, I spent and am spending all of my time chasing Microsoft techniques, it is very very annoying!!! :(
No,
But you can share code through the use of Portable Class Libraries or linked files.
I recently wrote two articles about how to achieve this:
The first one is about whether to choose PCL's or linked files:
http://www.kenneth-truyers.net/2013/03/27/portable-class-libraries-or-source-code-sharing/
The second one is about how to work around the limitations of PCL's:
http://www.kenneth-truyers.net/2013/02/24/patterns-for-sharing-code-in-windows-phone-and-windows-8-applications/
No. The two runtimes are not compatible.
If I need to develop an app to run on RT tablets and on windows 8 phones, what should I do?
You can use the portable class libraries to save logic, but not the presentation code.
You would then build your UI on each platform, using the appropriate tools for the platform.
You can't just run a xap on a tablet. You CAN however take almost all of the XAML and C# uncompiled code and recompile for the tablet. You just need to fix some of the idiosyncrasies in the syntax. Same goes for Windows 8 Pro.
I would like to develop a game for windows 8, but since Xna isn't supported, i don't really know, if it is good to use something like MonoGame - because i think, it doesn't make any sense to use MonoDevelop with OpenGL while the UI Frontend runs with DirectX. But my searches and on "apptivate.ms", they still force the developers to use MonoDevelop - but why would a corporation like Microsoft even do this?
And i don't like to build my game in C++ with DirectX, because in my case, it's not a big game, and my favorite language (also, my language at work) is C#..
Btw., it would not be a big deal for me to write this game with OpenGL or C++, because I've got a lot of experience in these two for the past four years, but in this case, i like to have a "fast" and "save" solution like C# and a Graphics Framework.
So... maybe someone has the answer to these qustions:
Should i use MonoGame with Xaml / C# and don't worry about the mix of DirectX and OpenGL?
Or is there even another DirectX/Game Framework which i can use?
Or maybe, i'm totally wrong, and Xaml doesn't need DirectX? Or i can force MonoGame to use DirectX?
Or, another point - would something like "System.Drawing" fast enough for a spaceshooter with some nice shading effects (I think, for my case, i need shading and something like bloom, blurring etc.)? Maybe, Microsoft added a new 2D drawing library? (But i think its still gdi+ )
Your question is ambiguous if you are referring to Windows 8 Metro (aka Modern) or Windows 8 Desktop, but I assume it's the Metro version.
If you want to develop a game in C# for Win8 Metro without using a commercial solution, you can use:
SharpDX which is a low level DirectX API for .NET or the up-coming SharpDX.Toolkit (check latest news on the website) which is a high level framework around Direct3D11 (with a XNA like API, but with full Direct3D11 support). SharpDX is the only C# wrapper covering the whole DirectX API that is certified to work under Windows 8.
MonoGame which is using SharpDX for its Metro backend. I haven't heard that you need to use MonoDevelop for it, as it is working with an existing XNA project and VS 2012 should work just fine.
ANX which is also using SharpDX for its Metro backend.
Concerning the previous answer, If Win8 Modern is assumed, you can't use OpenTK, as OpenGL is not a certified API for the Microsoft App Store and SlimDX is not compatible with Windows 8 Metro.
There is an OpenGL to DirectX wrapper in the works that allows use of OpenGL in Windows 8 Modern applications. It's not complete yet but it may be sufficient if you want cross-platform compatibility and are willing to target only the subset of OpenGL that is implemented (or are willing to implement the rest yourself and hopefully contribute back.)
https://gl2dx.codeplex.com
Update: gl2dx seems to be dead as of November 2013, but there is a similar project, ANGLE, which implements most (if not all) of the OpenGL ES 2.0 spec and the EGL spec on top of either DirectX 9 or 11. This is the method by which Firefox and Google Chrome do WebGL on Windows.
http://code.google.com/p/angleproject/
If you want to use OpenGL and c#:
http://www.opentk.com/
For DirectX and c#:
http://www.slimdx.org/
or
http://sharpdx.org/
GDI+ is out bounds of Metro/Modern UI apps, if you're interested there some companies that look to make replacement apis like this one: http://www.moderncomponents.com/products/DrawingLibrary/, it's still in it's early stages, but looks good and may help you to create some simple games.