从C ++到C#再回来...... [英] From C++ to C# and back again....

查看:50
本文介绍了从C ++到C#再回来......的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在一段时间后自学了C ++,但从来没有参与实际用它编写应用程序的
。我实际上在过去的6年中为无数的b
互联网网络公司工作,以及做了大量的b
自由网页开发工作。最近我开始学习

c#。我的想法是停止使用coldfusion并切换到使用asp.net编写c#的
。我相信的优势是

我可以开发重用代码的网站和软件,并且

在解决方案中捆绑在一起。这个想法对我来说非常令人兴奋。


我的其他激情和兴趣之一是游戏

开发。我已经浏览了很多不同的

网站并且一遍又一遍地阅读,尽管可以用c#进行
游戏开发;由于

使用.net等带来的性能问题,它只是不是实际的。


它但是,我的理解是,作为一个.net

应用程序运行,被调用的函数通过JIT编译器被编译为
本机代码。只编译了调用

的函数,但是一旦编译完成,就不会在程序的整个生命周期中重新编译
。除了

之外,编译后的代码更有效,因为它是专门为系统和处理器编译的b

。通常来说,作为一个.net程序

运行;它变得越来越快(显然在编译所有代码时达到了
高原)。


如果是这种情况,那么就不会编程游戏<使用.net的
,有更好的性能吗?是否有可能

仍然使用汇编代码或其他不安全的代码

用于性能关键的特定功能?


前几天我正在查看Quake II

引擎的Mangaged C ++端口,并在timedemo测试中读到了Running Quake

II.NET表示托管版本

的执行速度约为原生版本的85%。

http://www.vertigosoftware.com/Quake2.htm) 。对于为什么管理版本比较慢的原因,我们没有做过多的解释。


C#本身没有'''看起来它似乎是为了游戏

编程。我对吗? C ++

语言比C#有什么优势使它更适合游戏编程(语法不是性能)?

谢谢。

I taught myself C++ a while back, but never got to
involved in actually writing applications with it. I
actually spent the last 6 years working for numerous
internet web firms as well as doing a plethora of
freelance web development work. Lately I started learning
c#. The idea is to stop using coldfusion and switch to
writing c# using asp.net. The advantage I believe is that
I can develop websites and software that reuse code and
are tied together in a Solution. This idea is very
exciting to me.

One of my other passions and interests is game
development. I''ve looked around at a lot of different
websites and have read over and over again that although
game development with c# is possible; it''s just not
pratical, due to peformance issues brought on by
using .net, etc.

It is my understanding, however, that as a .net
application runs the called functions are compiled to
native code through the JIT compiler. Only functions that
are called are compiled, but once compiled, are not
recompiled through the life of the program. In addition to
this, the compiled code is more effecient since it is
compiled specifically for the system and processor it is
running on. And typically speaking, as a .net program
runs; it gets faster and faster (obviously hitting a
plateau when all code is compiled).

If this is the case, wouldn''t a game programmed
using .net, have better performance? Isn''t it possible to
still use pieces of assembly code or otherwise unsafe code
for specific functions where performance is key?

I was looking at the Mangaged C++ port of the Quake II
engine the other day and was reading that "Running Quake
II.NET in the timedemo test indicates the managed version
performs about 85% as fast as the native version."
(http://www.vertigosoftware.com/Quake2.htm). The didn''t do
much explaination as to why the managed version was
slower.

C# itself doesn''t seem like it was meant for game
programming. Am I right? What advantages does the C++
language have over C# that makes it better for game
programming (as far as syntax goes, not performance)?

Thank you.

推荐答案

Aaron,

您可以使用C#开发游戏。它可能比C ++稍慢(如果

设计和正确实现),你会更有效率。


游戏开发者很难转向C# 。他们已经使用了死硬的C ++

编码器,并且有很多关于C#的势利。此外,C / C ++用于为游戏机开发游戏。


首先,请尝试以下链接。


下载DirectX SDK
http://msdn.microsoft.com/library/de...st/directx.asp

托管DirectX的讨论
http://msdn.microsoft.com/newsgroups...&lang=en&cr=US

.NET Show的托管DirectX eposide
http://msdn.microsoft.com/theshow/Ep ... 37 / default.asp

MSD上的DirectX
http://msdn.microsoft.com/library/de...ch_directx.asp

有关托管直接的书籍
http://www.amazon.com/exec/obidos/AS...9919604-591356
http://www.amazon.com/ exec / obidos / AS ... 919604-5913560


祝你好运。

菲尔。


Aaron写道:
Aaron,
You can use C# to develop games. It may be slightly slower than C++ (if
designed and implemented properly) be you will be much more productive.

Games developers are slow to move to C#. They already employ die hard C++
coders and there is a lot of snobbery regarding C#. Also C/C++ is used for
developing games for the consoles.

To start, try the following links.

Download the DirectX SDK
http://msdn.microsoft.com/library/de...st/directx.asp

Managed DirectX discussio
http://msdn.microsoft.com/newsgroups...&lang=en&cr=US

Managed DirectX eposide of the .NET Show
http://msdn.microsoft.com/theshow/Ep...37/default.asp

DirectX on MSD
http://msdn.microsoft.com/library/de...ch_directx.asp

Books on Managed Direct
http://www.amazon.com/exec/obidos/AS...9919604-591356
http://www.amazon.com/exec/obidos/AS...919604-5913560

Good luck.
Phil.

"Aaron" wrote:
我在一段时间后自学了C ++,但从未参与实际用它编写应用程序。我实际上在过去的6年里一直在为众多的互联网网络公司工作,并且做了大量的自由网络开发工作。最近我开始学习
c#。我的想法是停止使用coldfusion并切换到使用asp.net编写c#。我相信的优势是,我可以开发重用代码的网站和软件,并在解决方案中捆绑在一起。这个想法对我来说非常令人兴奋。

我的另一个激情和兴趣是游戏开发。我已经浏览了很多不同的网站,并且一遍又一遍地阅读,尽管用c#进行游戏开发是可能的;由于使用.net等带来的性能问题,它只是不实用。

然而,我的理解是,作为.net <应用程序运行被调用的函数通过JIT编译器编译为本机代码。只编辑调用的函数,但编译后,不会在程序的整个生命周期内重新编译。除了这个之外,编译后的代码更有效,因为它是专门为运行的系统和处理器编译的。通常来说,作为.net程序运行;它变得越来越快(显然在编译所有代码时达到了一个高原)。

如果是这样的话,不会使用.net进行游戏编程,有更好的性能?对于性能至关重要的特定功能,是否仍然可以使用汇编代码或其他不安全代码?

我正在查看Mangaged C ++端口前几天Quake II
引擎正在阅读时间测试测试中的Running Quake
II.NET表明托管版本的执行速度比原生版本快85%。 ;
http://www.vertigosoftware.com/Quake2.htm )。对于为什么托管版本的速度慢了,没有做太多的解释。

C#本身似乎不适合用于游戏
节目。我对吗? C ++语言比C#有什么优势可以让它更好地进行游戏编程(就语法而言,而不是性能)?

谢谢。
I taught myself C++ a while back, but never got to
involved in actually writing applications with it. I
actually spent the last 6 years working for numerous
internet web firms as well as doing a plethora of
freelance web development work. Lately I started learning
c#. The idea is to stop using coldfusion and switch to
writing c# using asp.net. The advantage I believe is that
I can develop websites and software that reuse code and
are tied together in a Solution. This idea is very
exciting to me.

One of my other passions and interests is game
development. I''ve looked around at a lot of different
websites and have read over and over again that although
game development with c# is possible; it''s just not
pratical, due to peformance issues brought on by
using .net, etc.

It is my understanding, however, that as a .net
application runs the called functions are compiled to
native code through the JIT compiler. Only functions that
are called are compiled, but once compiled, are not
recompiled through the life of the program. In addition to
this, the compiled code is more effecient since it is
compiled specifically for the system and processor it is
running on. And typically speaking, as a .net program
runs; it gets faster and faster (obviously hitting a
plateau when all code is compiled).

If this is the case, wouldn''t a game programmed
using .net, have better performance? Isn''t it possible to
still use pieces of assembly code or otherwise unsafe code
for specific functions where performance is key?

I was looking at the Mangaged C++ port of the Quake II
engine the other day and was reading that "Running Quake
II.NET in the timedemo test indicates the managed version
performs about 85% as fast as the native version."
(http://www.vertigosoftware.com/Quake2.htm). The didn''t do
much explaination as to why the managed version was
slower.

C# itself doesn''t seem like it was meant for game
programming. Am I right? What advantages does the C++
language have over C# that makes it better for game
programming (as far as syntax goes, not performance)?

Thank you.



非常好的回复。谢谢。我最感兴趣的是

推荐的书籍(我非常擅长自学

使用书籍),看起来很棒(看过很多

评论)由于DX9的最新更新来自

Microsoft,因此大多数DX9书籍都存在编码代码的问题。


使用C#进行OpenGL编程怎么样? OpenGL仍然是DirectX的合格竞争对手吗? HL2使用DX9吧?并且

D3使用OpenGL吧?

Very nice response. Thank you. I was most interested in
the suggested books (I''m very good with self-teaching
using books), and it would seem (after reading many
comments) that most of the DX9 books have issues with
compiling code because of the latest updates of DX9 from
Microsoft.

What about OpenGL programming with C#? Is OpenGL still a
qualified competitor of DirectX? HL2 uses DX9 right? And
D3 uses OpenGL right?

-----原始消息-----
Aaron,游戏开发人员很难转向C#。他们已经花了b $ b雇用死硬的C ++编码器,并且有很多关于C#的势利。此外,
C / C ++用于开发游戏机游戏。

首先,请尝试以下链接。

下载DirectX SDK
http://msdn.microsoft.com/library/default.asp?
url = / downloads / list / directx.asp
托管DirectX讨论 http://msdn.microsoft.com/newsgroups/default.aspx?
dg = microsoft.public.win32.programmer.directx.manag ed& lang = e

n& cr = US
.NET Show的托管DirectX eposide
http://msdn.microsoft.com/theshow/Ep...37/default.asp

MSDN上的DirectX http://msdn.microsoft.com/library/default.asp?
url = / library / en-us / dnanchor / html / anch_directx.asp
Managed Direct X上的书籍
http:/ /www.amazon.com/exec/obidos/AS...25969/qid=1108
480784 / sr = 2-1 / ref = pd_ka_b_2_1 / 104-9919604-5913560 http://www.amazon.com/exec/obidos/AS .. .26612 / qid = 1108
480784 / sr = 2-2 / ref = pd_ka_b_2_2 / 104-9919604-5913560
祝你好运。
菲尔。

"亚伦"写道:
-----Original Message-----
Aaron,
You can use C# to develop games. It may be slightly slower than C++ (ifdesigned and implemented properly) be you will be much more productive.
Games developers are slow to move to C#. They already employ die hard C++coders and there is a lot of snobbery regarding C#. Also C/C++ is used fordeveloping games for the consoles.

To start, try the following links.

Download the DirectX SDK
http://msdn.microsoft.com/library/default.asp? url=/downloads/list/directx.asp
Managed DirectX discussion
http://msdn.microsoft.com/newsgroups/default.aspx? dg=microsoft.public.win32.programmer.directx.manag ed&lang=e
n&cr=US
Managed DirectX eposide of the .NET Show
http://msdn.microsoft.com/theshow/Ep...37/default.asp

DirectX on MSDN
http://msdn.microsoft.com/library/default.asp? url=/library/en-us/dnanchor/html/anch_directx.asp
Books on Managed Direct X
http://www.amazon.com/exec/obidos/AS...25969/qid=1108 480784/sr=2-1/ref=pd_ka_b_2_1/104-9919604-5913560http://www.amazon.com/exec/obidos/AS...26612/qid=1108 480784/sr=2-2/ref=pd_ka_b_2_2/104-9919604-5913560
Good luck.
Phil.

"Aaron" wrote:
我在一段时间后自学了C ++,但从未参与实际用它编写应用程序。我实际上在过去的6年里一直在为众多的互联网网络公司工作,并且做了大量的自由网络开发工作。最近我开始学习c
$ b。我的想法是停止使用coldfusion并切换到使用asp.net编写c#。我相信的优势是
,我可以开发重用代码的网站和软件,并在解决方案中捆绑在一起。这个想法对我来说非常令人兴奋。

我的另一个激情和兴趣是游戏开发。我已经浏览了很多不同的网站,并且一遍又一遍地读过
,尽管用c#进行游戏开发是可能的;由于使用.net等带来的性能问题,它只是不实用。

然而,我的理解是,作为.net <应用程序运行被调用的函数通过JIT编译器编译为本机代码。只编译被调用的函数
,但一旦编译,就不会在程序的整个生命周期内重新编译。另外
,编译后的代码更有效,因为它是专门为系统和处理器编译的,它是b $ b运行的。通常来说,作为.net程序运行;它变得越来越快(显然在编译所有代码时达到了一个高原)。

如果是这样的话,不会使用.net进行游戏编程,有更好的性能?对于性能至关重要的特定功能,是否仍然可以使用
仍然使用汇编代码或其他不安全的
代码?

我正在查看Mangaged C ++端口前几天Quake II
引擎正在阅读在timedemo测试中运行
Quake II.NET表明托管的
版本的执行速度比原生版本快85%。 ;
http://www.vertigosoftware.com/Quake2.htm )。没有
做了很多解释为什么托管版本更慢。

C#本身看起来不像是用于游戏
节目。我对吗? C ++语言比C#有什么优势可以让它更好地进行游戏编程(就语法而言,而不是性能)?

谢谢。
I taught myself C++ a while back, but never got to
involved in actually writing applications with it. I
actually spent the last 6 years working for numerous
internet web firms as well as doing a plethora of
freelance web development work. Lately I started learning c#. The idea is to stop using coldfusion and switch to
writing c# using asp.net. The advantage I believe is that I can develop websites and software that reuse code and
are tied together in a Solution. This idea is very
exciting to me.

One of my other passions and interests is game
development. I''ve looked around at a lot of different
websites and have read over and over again that although game development with c# is possible; it''s just not
pratical, due to peformance issues brought on by
using .net, etc.

It is my understanding, however, that as a .net
application runs the called functions are compiled to
native code through the JIT compiler. Only functions that are called are compiled, but once compiled, are not
recompiled through the life of the program. In addition to this, the compiled code is more effecient since it is
compiled specifically for the system and processor it is running on. And typically speaking, as a .net program
runs; it gets faster and faster (obviously hitting a
plateau when all code is compiled).

If this is the case, wouldn''t a game programmed
using .net, have better performance? Isn''t it possible to still use pieces of assembly code or otherwise unsafe code for specific functions where performance is key?

I was looking at the Mangaged C++ port of the Quake II
engine the other day and was reading that "Running Quake II.NET in the timedemo test indicates the managed version performs about 85% as fast as the native version."
(http://www.vertigosoftware.com/Quake2.htm). The didn''t do much explaination as to why the managed version was
slower.

C# itself doesn''t seem like it was meant for game
programming. Am I right? What advantages does the C++
language have over C# that makes it better for game
programming (as far as syntax goes, not performance)?

Thank you.




关于汇编和不安全代码的问题怎么样?我还没有在我的c#book中得到不安全的代码,汇编代码可以用在一个必须要求性能的
c#应用程序中吗?

What about my question concerning assembly and unsafe code; I haven''t
gotten to unsafe code in my c# book yet, can assembly code be used in a
c# application where peformance is imperative?


这篇关于从C ++到C#再回来......的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆