C# Equivalent to java's Graphics2D - c#

I've recently started about thinking about making a 2D game engine in C# from scratch.
Now, I've wondered: In java, I'd use the java.awt.Graphics2d and java.awt.Container classes.
What would you suggest me to use in C#?
Apparently, google couldn't help me with that one.

In .NET you could use Windows Presentation Foundation, it offers a great lot of graphic-manipulation. But if it fits to create a game-engine, I am not sure.
See MSDN for an overview.
Though, if you really want to have power, you should stick with DirectX and C++.
Note: there is FNA and MonoGame (both reimplementations of the now discontinued XNA), but they are both frameworks for creating games, not creating a game engine...

You can easily build games (2D/3D) with FNA or MonoGame (reimplementations of the now discontinued XNA). They aren't engines but they are both a layer architecture for simple DirectX-usage.
If you're looking for image manipulation within Windows Forms (PictureBox, Draw()-method overrides) you should have a look at System.Drawing.

Related

What's the deal with Monogame, SharpDX, and XNA?

I've been doing research on good tools to create games with, and I came across Monogame, Sharpx, and XNA. I have some questions regarding each:
When I create a new windows project (which advertises that it uses DirectX 12), the code template looks like this:
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
I understand Monogame is a re-implementation of XNA, but where is the "re" part? This code shows Monogame using Microsoft's XNA, and doesn't even hint at the usage of DirectX 12.
SharpDX has an advantage of using WinRT (so i've heard), but what exactly does that mean to me? I know that SharpDX is a layer that sits on top of DirectX to allow it to be used in C#, and naturally should use WinRT. What excuse does Monogame have not to use WinRT?
I feel I'm confused at something and want clarity. Keep in mind that I'm a total noob at this stuff, anything helps!
MonoGame is indeed a reimplementation of XNA. It uses Microsoft.Xna.Framework.* namespaces to preserve source code compatibility with XNA projects. MonoGame does not currently support DirectX 12 - the desktop version has DirectX 11 and OpenGL backends.
It provides simple, cross-platform classes for common game tasks (loading content, rendering, sound playback, etc.) and a pipeline for building runtime-optimized content files. MonoGame is really powerful for most projects and great for quick development, though not a fully featured game engine like Unity. Since it is modelled after XNA (discontinued a few years ago), most XNA samples/tutorials work just fine.
SharpDX is a low-level wrapper of DirectX types. You should go with it only if you want to get your hands dirty with low-level plumbing, which doesn't appear to be the case.
The DirectX implementation of MonoGame (used for classic Windows, UWP, and Windows 8 apps) internally uses SharpDX for communicating with DirectX. When it comes to WinRT, it is just an implementation detail of "modern" Windows app platform.
Wikipedia has a few pages on the history of XNA. In short it is no longer supported. MonoGame extends it. SlimDX and SharpDX use their own DirectX wrappers and are basically copies of each other. Going by a recent post SlimDX future
It will not be continued. I do not know MonoGame but am strong in SharpDX and it provides current support for DirectX 12. If you also want to use OpenGL, you could try ANX but I do not know it. The SharpDX guy also wrote a Collada class which is on GitHub and there is an Assimp class that is compatible. None of the above have an integrated physics system but PhysX for .Net works fine with SharpDX.
In summary if you only need Direct X for C# then SharpDX would be the most straight forward choice. If you think you might expand to other platforms, you might want to check out MonoGame or ANX but I can't vouch for either. None of the above mentioned are complete Game Engines (such as Unity or UE4) they simply allow the use of features such as DirectX that are not natively supported by Visual Studio C#.

Is there any good 3d engine exists for winrt applications?

i want to do some complex 3d transformations in my winrt application, i found this is possible with Matrix3DProjection,but it is really hard to understand. is there any alternate for this for winrt applications?
I expect you should be using DirectX which should work across all Windows 8 based platforms.
Ogre3D has a WinRT renderer. It is one of the most widely used open source 3d engines and has a permissive license.
If your budget allows i will recommend Unity3D it is easy to learn professional engine that targets pretty much all platforms from PC to IOS and flash player. Also it has development tools and huge community.

Which Graphics Framework for Windows 8? MonoGame? OpenGL and Xaml/DirectX Mixing?

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.

Render environment in DirectX

I want to program for DirectX in C# and i have DirectX SDK,
what kind of project should be choose ? Windows form or ....
You should ask yourself first: What's the purpose of my project?
If you intend to building applications with beautiful 2D-3D visuals, then you just need to learn WPF.
On the other hand, if you wanna build games that require a lot of resources, XNA is the way to go.
Building applications on XNA is a lot of pain, since XNA is built for gaming.
The same can be said about building games with WPF.
In both cases, you don't need to communicate natively with DirectX (Which could be done via C++). Unless you're building a low level rendering engine, or a (very) high budget game.
You should use XNA, that is the replacement for Managed DirectX C#
Microsoft XNA ('XNA's Not Acronymed) is a set of tools with a managed runtime environment provided by Microsoft that facilitates computer game development and management. XNA attempts to free game developers from writing "repetitive boilerplate code" and to bring different aspects of game production into a single system.
From Wikipedia XNA Article.
Unless you want to just render windows but WPF might be the best options. See this blog post.
XNA:
XNA is a game oriented framework that allow you to target multiple hardware easily (Windows, the Xbox 360, Zune and now Windows Phone 7 with version 4) using .NET languages like C#.
Note that there's not a 1-1 relation between XNA and the DirectX SDK, for instance, it doesn't expose D3D10 or D3D11 or some interfaces that you can find in D3DX.
.NET Wrappers:
If your are looking for something similar than the native DirectX API, you have 3 options:
Windows® API Code Pack for Microsoft® .NET Framework:
wraps a bunch of Windows native libraries such as DirectX so they can be used from managed code. Note it doesn't expose API's prior to D3D10 such as D3D9.
SlimDX: Same thing but only for DirectX and exposes Direct3D from version 9 to 11 (SlimDX is an aside project that is not related to Microsoft).
C++/CLI and DIY the wrapper: Unless you have special needs, I wouldn't recommend it.
The final choice depends on your needs. If it's just for learning purpose of the DirectX API but in C#, I would say pick the Windows API Code Pack or SlimDX.

Lightweight 3D Graphics Engine .NET (Compact and Full Framework)

I am creating a GUI for a machine that runs remote (WinXP) or on the machine itself (Windows CE 6.0).
Right now I've created a fast visualisation (read: very simple) of the machine itself. The goal is to make a bit more complex visualisation of the machine and for that I would need a lightweight 3d engine.
The engine should run on both full and compact .net framework (I am prepared to do some porting :).
What I mean with lightweigt is that it doesn't need shading, lighting, advanced camera's. The Idea is that the whole scene is shown in Isometric perspective.
So what I was wondering is that anyone knows a good engine (open source?) or has some helpfull resources you could share with me.
Did you try Irrlicht.
Recently Irrlicht has acquired official .NET bindings, allowing users to develop in .Net languages such as VB.NET, C# and Boo.
There is also Ogre 3D and also Axiom Engine
It is a good question. I have looked as well, and not seen anything. It would be great to see some easy to access great visual effects for mobile, to somewhat compete with other platforms that are getting better looking.
Sometimes with Windows Mobile I feel like I am in the Windows 3.1 days!
TrueEngine 3d sdk may also be of interest to you.
There is also SlimDX

Categories