English 中文(简体)
C++中的写作,接触C#或直接在C#中书写?
原标题:Write in C++ and expose to C# or write directly in C#?

我在撰写我自己的2D(可能还有3D)游戏引擎之前,正在做一些研究。 在使用C#和XNA之前,我已经成为一个发动机,但我本希望通过在C++使用开放式等新的发动机来跨越平台。

但...... 我仍然希望从C#开始的快速循环时间,能够进入那里的游戏引擎。

因此,我在此有几个选择。

  1. Write the engine and a CLI wrapper in C++
  2. Write the whole thing directly in C#, no C++
  3. Write in C++ and use Mono to load C# Code / Assemblies into the engine.
  4. No C#
  5. ... Probably something I didnt think of yet

我认为,我确实需要加快烹饪、图像 st、矩阵计算、微粒系统等。

Wat are the Pros and Cons? What do you suggest?

最佳回答

如果你想要跨越平台,你可以使用C++/CLI。 该信在Windows以外的任何平台上都得到了支持。

尽管如此,对于跨平台,我要么使用C# with Tao,要么使用C++将发动机变成一个图书馆,而利用Invoke从你的C#代码中“使用”图书馆。 这将为你提供核心发动机(C++)所需的速度和控制,使C#的游戏设计具有灵活性。

这为开发能够接触C#的游戏引擎提供了一种清洁的跨平台。

问题回答

隧道框架已死亡,可尝试

优化的C++代码将大大加快(在32个轨道上为20%,在64个轨道上为40%;C#在64个轨道上比C#在32个轨道上慢,但又是另一个员额)。 我将利用C++图书馆的大量数学(整合、差异等)。





相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

NSArray s, Primitive types and Boxing Oh My!

I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

How to Use Ghostscript DLL to convert PDF to PDF/A

How to user GhostScript DLL to convert PDF to PDF/A. I know I kind of have to call the exported function of gsdll32.dll whose name is gsapi_init_with_args, but how do i pass the right arguments? BTW, ...

Linqy no matchy

Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...

热门标签