游戏开发论坛

 找回密码
 立即注册
搜索
楼主: wocen

什么是游戏引擎? 学习c++之前需要学习c吗?

[复制链接]

6

主题

125

帖子

129

积分

注册会员

Rank: 2

积分
129
 楼主| 发表于 2006-10-16 02:52:00 | 显示全部楼层

Re:什么是游戏引擎? 学习c++之前需要学习c吗?

我真受不了啦  大陆的教育者都是猪  出来的学生猪都不如  griffin2007  你和你妈根本就是两种不同的生物是吗? 你只是抄袭了很多你妈的东西  right?


History

Stroustrup began work on C with Classes in 1979. The idea of creating a new language originated from Stroustrup's experience in programming for his Ph.D. thesis. Stroustrup found that Simula had features that were very helpful for large software development, but the language was too slow for practical use, while BCPL was fast but too low-level and unsuitable for large software development. When Stroustrup started working in Bell Labs, he had the problem of analyzing the UNIX kernel with respect to distributed computing. Remembering his Ph.D. experience, Stroustrup set out to enhance the C language with Simula-like features. C was chosen because it is general-purpose, fast, and portable. Besides C and Simula, some other languages which inspired him were ALGOL 68, Ada, CLU and ML. At first, the class, derived class, strong type checking, inlining, and default argument features were added to C via Cfront. The first commercial release occurred in October 1985.[1]

In 1983, the name of the language was changed from C with Classes to C++. New features were added including virtual functions, function name and operator overloading, references, constants, user-controlled free-store memory control, improved type checking, and a new single-line comment style with two forward slashes (//). In 1985, the first edition of The C++ Programming Language was released, providing an important reference to the language, as there was not yet an official standard. In 1989, Release 2.0 of C++ was released. New features included multiple inheritance, abstract classes, static member functions, const member functions, and protected members. In 1990, The Annotated C++ Reference Manual was published. This work became the basis for the future standard. Late addition of features included templates, exceptions, namespaces, new casts, and a Boolean type.

As the C++ language evolved, a standard library also evolved with it. The first addition to the C++ standard library was the stream I/O library which provided facilities to replace the traditional C functions such as printf and scanf. Later, among the most significant additions to the standard library, was the Standard Template Library.

After years of work, a joint ANSI-ISO committee standardized C++ in 1998 (ISO/IEC 14882:1998). For some years after the official release of the standard in 1998, the committee processed defect reports, and published a corrected version of the C++ standard in 2003. In 2005, a technical report, called the "Library Technical Report 1" (often known as TR1 for short) was released. While not an official part of the standard, it gives a number of extensions to the standard library which are expected to be included in the next version of C++. Support for TR1 is growing in almost all currently maintained C++ compilers.

While the C++ language is royalty-free, the standard document itself is not freely available.
[edit]

The name "C++"

This name is credited to Rick Mascitti (mid-1983) and was first used in December 1983. Earlier, during the research period, the developing language had been referred to as "new C", then "C with Classes". The final name stems from C's "++" operator (which increments the value of a variable) and a common naming convention of using "+" to indicate an enhanced computer program. According to Stroustrup: "the name signifies the evolutionary nature of the changes from C". C+ was the name of an earlier, unrelated programming language.

Stroustrup addressed the origin of the name in the preface of later editions of his book, The C++ Programming Language, adding that "C++" might be inferred from the appendix of George Orwell's Nineteen Eighty-Four. Of the three segments of the fictional language Newspeak, the "C vocabulary" is the one dedicated to technical terms and jargon. "Doubleplus" is the superlative modifier for Newspeak adjectives. Thus, "C++" might hold the meaning "most extremely technical or jargonous" in Newspeak.

When Rick Mascitti was questioned informally in 1992 about the naming, he indicated that it was given in a tongue-in-cheek spirit. He never thought that it would become the formal name of the language.
[edit]

Future development

C++ continues to evolve to meet future requirements. One group in particular, Boost.org, works to make the most of C++ in its current form and advises the C++ standards committee as to which features work well and which need improving. Current work indicates that C++ will capitalize on its multi-paradigm nature more and more. The work at Boost, for example, is greatly expanding C++'s functional and metaprogramming capabilities. A new version of the C++ standard is currently being worked on, entitled "C++0X" (denoting the fact it is expected to be released before 2010) which will include a number of new features.

248

主题

2674

帖子

2702

积分

金牌会员

Rank: 6Rank: 6

积分
2702
QQ
发表于 2006-10-17 03:08:00 | 显示全部楼层

Re:什么是游戏引擎? 学习c++之前需要学习c吗?

c++野史:

c作为一个编写操作系统的为目的的语言,抄了当时最为流行的若干种语言的特色,但是因为实际需要,对效率的坚持比功能强大的语言功能更加强烈。因此,c 肤浅的理解就是让汇编写得快点。

c之后,终于有人受不了这套汇编升级版语言,将时下最酷,最流行的概念添加进入c的语法中,自称“很酷的带面向对象特色的c语言”。这就是c++的前身。c++作者绝对不是个造作的人,摆明是修改c而得到的。正因为这样,吸引了不少喜欢酷,而又有c背景的人。

人民群众是历史的推动者,一个受欢迎的语言,绝对不会停止发展的脚步。在几十年的历史中,c++一如既往地添加当时最酷的语言特色,终于,成就了一个“超级语言”。

59

主题

1104

帖子

1199

积分

金牌会员

Rank: 6Rank: 6

积分
1199
发表于 2006-10-17 14:19:00 | 显示全部楼层

Re:什么是游戏引擎? 学习c++之前需要学习c吗?

wocen同学还真是够无知的。

首先说说c和c++的implicit conversion,在c里:
int *p = malloc(10); 是合法的,因为c认为void *可以转换为任意pointer。
但是在c++里是不合法的,我们需要做int *p = (int *)malloc(10); c++认为没有把void *到任意类型的pointer认为是implicit conversion,而是explicit conversion。

再次,因为c++有很多的新的保留字,所以很多c代码类似:
struct template { };这样就会编译通不过。

另外还有一点就是在c++里面,c++里面不允许goto用在函数头,但是在c99里这是允许的,比如:
void fn(void){
  goto Hell;
  int i = 1;
Hell:
  ;
}

你知道吗,在c里enum被认为是int,而在c++里,enum被严格的认为是另外一种不同于int的类型。

在c里,'a'被认为是int,但是在c++里认为是char,当sizeof('a')的时候在c和c++里得到的是不同的结果。

在c++里bool是built-in的type,在c里,bool则是在stdbool.h里定义的类型。

另外最关键的是c99的很多特性都是c++不支持的,包括在函数prototype里定义enum, struct, union以及在函数声明的时候指定数组参数的大小之类的。

另外我要再郑重说明,c和c++是两种语言,语法类似而已,之所以两者这么象,甚至99%的c代码都可以用c++的编译器编译是出于c++作者Bjarne Stroustrup的初衷,他希望他的c++和c尽可能的保持一致从而减少移植的困难。

以上是从语言的角度来说c和c++的区别,要从设计模式的角度来考虑的话,c和c++根本就是水里游的鱼和天上飞的鸟一样,完全不一样。

另外说到引擎,你愿意为了给自己的车子多加一颗螺丝而去重新要求汽车公司为你重新定做?了解引擎不一定是为了编写自己的引擎,同样也适用于小范围的维护和挖掘已经存在的引擎的价值。一辆汽车,不懂得维护汽车的人,汽车的寿命甚至于性能可能只有本来的80%,而熟悉汽车的人则可能可以将他的汽车的寿命和性能提高到原来的120%。更何况,如果世界上没有人做引擎,你上哪买去?

6

主题

125

帖子

129

积分

注册会员

Rank: 2

积分
129
 楼主| 发表于 2006-10-19 01:56:00 | 显示全部楼层

Re:什么是游戏引擎? 学习c++之前需要学习c吗?

tarkey   种地去吧  农妇 山泉  有点田

0

主题

12

帖子

12

积分

新手上路

Rank: 1

积分
12
发表于 2006-10-24 14:17:00 | 显示全部楼层

Re:什么是游戏引擎? 学习c++之前需要学习c吗?

lz有点问题。。。情绪不对。。。看着我难受。。。

15

主题

1268

帖子

1268

积分

金牌会员

Rank: 6Rank: 6

积分
1268
发表于 2006-11-15 10:23:00 | 显示全部楼层

Re:什么是游戏引擎? 学习c++之前需要学习c吗?

前一个问题不知道回答。
第二个问题是,需要学习C,C的执行效率较C++高,因为C++存在一些虚拟化的部分,需要运行时处理,降低速度。

15

主题

1268

帖子

1268

积分

金牌会员

Rank: 6Rank: 6

积分
1268
发表于 2006-11-15 10:26:00 | 显示全部楼层

Re:什么是游戏引擎? 学习c++之前需要学习c吗?

楼主估计不是中国人,而且看起来精神有点问题。

149

主题

4981

帖子

5033

积分

论坛元老

Rank: 8Rank: 8

积分
5033
QQ
发表于 2006-11-15 11:06:00 | 显示全部楼层

Re:什么是游戏引擎? 学习c++之前需要学习c吗?

楼主明显是那种情绪化的人,不够理性。
关于“买船”还是“造船”,我想讨论已经够多了。对玩家来说,当然要的只是游戏,玩家不需要考虑什么引擎不引擎的。就游戏开发而言,不得不考虑引擎,如果买引擎,那么会有相当大的花费,而且你能买得到的引擎也未必就适合自己,到时候还要再修改就很痛苦了;如果自己做引擎,那么可以掌握自主权,当然风险也大。事情不是那么绝对的,就像tarkey所说,这个世界总是需要人来开发引擎的,而我们也不能永远处于产业链的下游,必须要向上发展才有未来,所以必须开发自己的引擎,否则永远在为别人打工,永远受制于人,毕竟这个世界还没有大同。


我认为学C++之前一定要学C。因为从微观来看,C++的一个函数内部仍然是面向过程的,所以我一直觉得,所谓的面向对象是宏观上的,而微观上看,一个对象的各种方法,其内部仍然是面向过程的,所以面向对象和面向过程不是对立的,而是彼此配合的。再说C++和C在语法上有很大的相似性,C++也可以当作better C来用,所以可以先从C开始学习,一方面可以说这是从微观入手,打好基础,另一方面也可以避开一些面向对象中的复杂概念,更容易入门。


另外,wocen,我这些不是为了回复你,而只是就你楼顶的帖子里的内容发表自己的看法,我不指望你理性的回应,只是希望我的回复对别人能够有点意义。

149

主题

4981

帖子

5033

积分

论坛元老

Rank: 8Rank: 8

积分
5033
QQ
发表于 2006-11-15 11:08:00 | 显示全部楼层

Re:什么是游戏引擎? 学习c++之前需要学习c吗?

补充一下,楼主楼顶的帖子里,其实是从游戏玩家的角度来看问题,但是这里都是搞游戏开发的,所以大家都是从游戏开发的角度来看问题的……所以……

0

主题

275

帖子

676

积分

高级会员

Rank: 4

积分
676
发表于 2006-11-15 11:56:00 | 显示全部楼层

Re:什么是游戏引擎? 学习c++之前需要学习c吗?

就??蛞??碚f
?然不需要每??人都研???蛞?
?是要有人在汽?工?鲅邪l新引擎
你看油?引擎 ??庖??.
?不能都石油都乾了才慢慢想?法

就C跟C++?碚f??T用啥就用啥
高?插入一行asm ?是呼叫lua
看使用者的需求
肯定是??虺淌皆O???????蛑挥?我徽Z言是不?虻

光是跟??蚱???贤ň鸵?玫降厍蛘Z言

?言只是?贤ǖ墓ぞ?

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

作品发布|文章投稿|广告合作|关于本站|游戏开发论坛 ( 闽ICP备17032699号-3 )

GMT+8, 2026-1-25 20:47

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表