PDA

View Full Version : I Want To Learn GL Should I Learn C++



SADIST
06-30-2002, 05:26 AM
I really want to learn GL ive used basic Pascal in the past, The big Q is, Is C++ still the main language used to code OpenGl Games etc or is there another Language, Any tips on the best route to take, Where to start, What software to use, Recommended Readings would be really helpful and appreciated. It is mainly game creation i am intersed in.
http://www.opengl.org/discussion_boards/ubb/smile.gif

BlackJack
06-30-2002, 06:00 AM
Yes, C++ is in any case the best choice. I programmed for years now majorly with Delphi and only rarest in C++, but now after moving completely to C++ I'm very happy about that I finally did this step. I personally think Delphi/Pascal is far easier than C++, but latest, if you want to do anything professional or fast, you should take C++. Our last project was done with Delphi, 150,000 lines, but we detected unfortunately too late that Delphi is a one way street and ended with writing all of our time critical code in 100% assembler using SSE and 3dnow to even out the sucky Delphi compiler. So well... if you want to do it right, use C++ from the beginning on or you might be later very sorry about it.

BlackJack

p.s. You should stay away of the GLUT and GLU helper units. They save time and support dumbness, but if you ever want to port your engine or what ever you are going to do to DirectX you'll be very sorry then http://www.opengl.org/discussion_boards/ubb/wink.gif.

zen
06-30-2002, 10:59 AM
I feel like starting a flamewar so I have to say that you'd be better off with plain old C(and maybe some assembly later for optimizations).I can imagine how C++'s bloatedness and complexity(that is design-complexity not difficulty of use) can be overlooked in favour of the organization(classes and stuff) and the easier team programming in an equally big and bloated project(like those custom software ordered by organizations or the army),but for low-level programming such as graphics programming I can't see why one would use C++.Maybe just because the ++ and the fact that it's newer makes it sound 'better' thn old C.Or maybe because it's regarded as easier than C.Well easier doesn't always mean better,usually means worse.Maybe it's just a matter of taste...

Let The Flames Begin...

PS:If in fact you're not conquered by the dark side of the force and you do choose C.Get the book by Richie and Kerningham which covers all of c and is very small compared to some "Learn C++ in 666 days" monsters.You can easily read it two or three times in no time.Bear in mind thouh that it is a C manual not a programming manual.If you don't know much about programming you might want to do some some pascal tutorials and simple programms first to get the hang of it and then move on to C.You won't regret it.If this looks like a long procedure also bear in mind that you won't go far into graphics programming w/o patience.

PS2 http://www.opengl.org/discussion_boards/ubb/biggrin.gifamn I love it when I talk like I know everything when in fact I learned C myself just 2.5 years ago.

[This message has been edited by zen (edited 06-30-2002).]

LuciferInSight
06-30-2002, 12:37 PM
In regards to the flame war respones id have to say go with C++ rathen C in the respect that when using API's such as OpenGL and DirectX 8.1 youll run into some case scenario where the API doesnt support the simple C format any longer and requires the use of a C++ class or method. if you have any more questions or need help learning the language contact me at DerrekMC@hotmail.com

SADIST
06-30-2002, 01:47 PM
Thanx all above, So i feel that C++ is the road to take (Sorry Zen....). Can any one recommend a compiler to start on. Is MS Visual C++ the best. Price dosnt matter just what ever one is easiest to get started on and is unrestricted in its features i suppose.
http://www.opengl.org/discussion_boards/ubb/smile.gif

BlackJack
06-30-2002, 03:33 PM
Zen.... I personally would be very surprised, if C is faster than C++. Afer all C++ allows a lot more perverse constructions which are surely far better optimizeable than if you would write them into tons of single lines. And if your code is clean or not depends after all on you, not on the language. http://www.opengl.org/discussion_boards/ubb/wink.gif Same about teamwork.

And if you want speed, well, in that case I use anyway pure assembler if even the optimizations the VC++ compiler does are still too bad.

BlackJack

zen
06-30-2002, 04:30 PM
Hi Blackjack,
I never reffered to speed as an advantage of C versus C++.Speed depends on the coder mostly.Even if some features of C++ are be slow you don't have to use them(or at least not in the inner loop).The fact that you don't write tons of single lines doesn't mean that the compiler doesn't do that for you.I think you will agree that the more low-level something is the more optimizable it is(for _all_ situations).That is because you have more freedom to do optimizations suited for your specific situation instead on relying on the compiler to do so who usually doesn't know anything about your specific situation.That is also why you resort to pure assembly to optimize what the compiler can't.This of course assumes that the programmer is capable of optimizing the code so,as I said,speeds depends on the coder and not the language.And besides the only thing that might make C++ a bit faster than _ANSI_ C is the inline statement but most C compilers have this feature anyway.Most other things like overloading etc. are just there to make the code more readable and to help the programmer.
I also didn't say anything about the code you write.It can be clean or dirty in any language.I mentioned teamwork because OOP with classes etc. might make it easier to break up a very big and complex programm into smaller parts which can be then allocated among the available programmers.But as you said this mostly depends on the design of the application.What I said is that I like C because of it's design simplicity.It has everything that is needed to make everything you can do with just about any high-level language and only that.This gives you the most control of your code which,of course you can get with C++ if you don't use it's fancy features,but then C++ becomes C.
Lucifer:I don't know about DirectX but opengl doesn't use classes or methods or anything OOP-related.This gives the programmer the freedom to choose wether his app will be OOP or not.If DX forces you to use OOP then it's DX that has the problem not C.

Questions Burner
07-01-2002, 03:34 AM
Learn C++, if you know C++, you'll surely know C. Operator overloading, inheritance, class, constructor and destructor, default parameter, polymorphism etc is enough to convice you to learn C++.

ANYTHING JUST DON'T LEARN VB.

velco
07-01-2002, 10:03 AM
Originally posted by Questions Burner:
Learn C++, if you know C++, you'll surely know C. Operator overloading, inheritance, class, constructor and destructor, default parameter, polymorphism etc is enough to convice you to learn C++.

That sounds as a good reason to NOT learn C++ as a first step in learning OpenGL. AFAICT, there ain't such thing as a C++ binding for OpenGL. And, of course, the above terms characterize object-oriented design approach, not C++, and are equally applicable to design's implementation in any (sensible) language. That is not to say C++ is bad, it is not, it is just a bit harder to create an efficient program in C++ http://www.opengl.org/discussion_boards/ubb/wink.gif IMHO, the extra care needed around not so apparent (copy) constructors, completely eliminates the convenience adavantage of the syntactic support (a.k.a sugar :P ) for OO concepts.



ANYTHING JUST DON'T LEARN VB.

I can only second that. Amen.

Regards,
-velco

zen
07-01-2002, 01:49 PM
I'll have to agree with velco.Also regarding VB sadist's initial question was wich language to learn.Since VB doesn't(IMHO) really qualify as a language it shouldn't be an option in the first place.So:


ANYTHING JUST DON'T LEARN VB.

I'll ...um third that

svc2211
07-01-2002, 05:30 PM
you should learn CPP it's the best there is.

and to help you learn CPP and opengl try these tutorials at www.gametutorials.com (http://www.gametutorials.com) . There are a lot of very good tutorials for both CPP and OpenGL there.

Have fun

[This message has been edited by svc2211 (edited 07-01-2002).]

Robbo
07-02-2002, 03:01 AM
Amazing! Some people are still coding with str8 C?

I haven't done that since I was at Uni. Hmmmm. I've used VB - which is great for rapid application development - at work I'm currently using VC++. The C++ features are extremely useful. Its a balance between code speed, readability and ease of maintenance. C++ offers advantages in all of these areas. If you want killer speed, you'd better write in Assembler and write a different function for each processor type you encounter (that means, you'd better be a whizz at Microelectronics) - I think Carmack said that the Assembler crews really amuse him. Hes just using str8 C++ now. If its good enough for him, its good enough for me http://www.opengl.org/discussion_boards/ubb/wink.gif

If you look at the assembly output of a C++ class with that of a C module written to do the same thing, you probably won't see any difference. Copy constructor semantics make a difference when performing a deep copy, but with C you don't even get the option to do that! If you don't understand C++, you'll have a hard time writing efficient code, same as with C, same as with Assembler, same as, even with VB.

Note: VB is not something you should `stay away from' - its an excellent way to quickly prototype GUI programs and for writing GUI `busy' programs in general as quickly as possible. Some of us live in the real world, where every hour a programmer is typing away at his desk costs lots of $$$.

Having said that, I wouldn't write an OpenGL app with VB - a DirectX app would be a slightyl different matter. If you want to learn graphics programming concepts, then sure you can use VB because you already know it so your learning curve won't be OpenGL AND C++, it'll just be OpenGL.

Julian
07-02-2002, 05:33 PM
To quote the glossary in "the red book" OpenGL Programming guide Third Edition

C Gods programming language

C++ The object-oriented programming language of a pagan deity

I guess programming languages like religion is about personal choice

Julian

velco
07-02-2002, 10:47 PM
Originally posted by Robbo:

Amazing! Some people are still coding with str8 C?


Amazing ? That some people want the work DONE ? :P

In my experience, a C++ program was often _slightly_ easy to write and _slightly_ harder to write it right, than a C program.


Copy constructor semantics make a difference when performing a deep copy, but with C you don't even get the option to do that!

Yeah, right! I can surely do deep copy with C.



If you don't understand C++, you'll have a hard time writing efficient code, same as with C, same as with Assembler, same as, even with VB.


Sure. And since C is much smaller and much easier to understand compared to C++, it is much easier to write efficient code in C. Glad we are on the same opinion here http://www.opengl.org/discussion_boards/ubb/smile.gif


Some of us live in the real world, where every hour a programmer is typing away at his desk costs lots of $$$.


Well, VB programmers do not cost THAT much, compared to, e.g., an embedded software engineer, coding in str8 C.

And speaking of real world, how expensive is the actual coding, relative to the other activities in the life cycle of a project. Compared to analysis and design, maintainance, advertisement, etc ?



If you want to learn graphics programming concepts, then sure you can use VB because you already know it so your learning curve won't be OpenGL AND C++, it'll just be OpenGL.


That's the point. Not C++ AND OpenGL but just OpenGL. Of course, one still needs SOME language, so just learn C - small, easy, efficient, portable and a good first step towards C++ or Java or C# or whatever is the fasionable today.

Regards,
-velco

thelamberto
07-04-2002, 06:40 AM
To quote the glossary in "the red book" OpenGL Programming guide Third Edition

C Gods programming language

C++ The object-oriented programming language of a pagan deity

I guess programming languages like religion is about personal choice

Julian

Amen

Does this mean VB is for the atheists amongst us??? http://www.opengl.org/discussion_boards/ubb/tongue.gif

zen
07-04-2002, 09:24 AM
Let's better not turn this thread towards religion.We're going to make an even bigge mess out of it that it is now.

SADIST
07-04-2002, 11:25 AM
Oppps, What have i started hear. It can get pretty hot in here but seriously thanx all you guys some good arguments. But im all set now on C++ can any one recommend A good compiler, And any more links to tuturials would be really appreciated?

CopyCat
07-05-2002, 12:21 AM
First thing - Carmack uses C not C++.
Second.
OOP - well it's a programing model.
You can write apps with OOP technics in pure ANSI C - structures with pointers to unfctions inside them ( and that will be even faster then RTTI in C++ http://www.opengl.org/discussion_boards/ubb/smile.gif - just assign the pointer to the field in struct - in C++ it is done every time the func is called ).
Now C is better, has better compilers.
Is more cross platform ( well...look at it...some platforms - like consoles don't have C++ compilers, other have very poor ).
And another thing - C is more standarized - like with C++ you have like MS C++ , Borland C++ etc ( very little diffrence - namless unions etc - I don't think that this works in GNU g++ http://www.opengl.org/discussion_boards/ubb/smile.gif ( not in 2.9x.x ) ).

If you're good and think a bit you will write better ,faster more efficient code in C rather then in C++.
And don't get me wrong. I know C++, coded it for some time.
But moved to pure C.
Is better.
And the last thing - it not the language counts ( that much ), but the coder skills.

END.

zen
07-05-2002, 02:35 AM
Carmack uses C?How do you know,have you taken a look at the quake2 sources?The variable naming convention he uses in the console(like FirstLetterCapital) looked suspiciously C++ like to me.Anyway you can't really say that you can write more efficient code with C++ than with C.Remember that code eficiency(as in the microsecond difference) only matters at some points like in the inner loop that get's called a million times per sec.If you don't use the slower features of C++ there(i.e. if you use more or less C there) you shouldn't have much of a speed impact.Of course knowing what is slow and what isn't is a little tricky.C is much closer to the way the computer works.A struct for example is nothing more than a chunk of memory which holds all it's members with labels that allow you easy access to them.Something like struct.member is nothing more than *(typeofmember *)(addressofstruct+offsetofmember) (you can even access the member yourself alhough that doesn't always work as the compiler might insert padding to ensure alignment).You more or less know what the compiler does and therefore can control it much better(and easier).That's what I initially meant by simplicity in design.C++ can be much more complex and thus more difficult to optimize.Of course you could say something like 'if you want it to be easy learn VB' but you don't get any more power out of this complexity just some ease in organizing your code which can be much more difficult in C.Anyway you can't say what is better and what isn't(although C clearly is http://www.opengl.org/discussion_boards/ubb/smile.gif) but for me the extra control,freedom and compiler-independence matters more than some syntactic sugar to help me organize my code.Of course the other things copycat has mentioned are important too.

Robbo
07-05-2002, 04:02 AM
No - ehem. These days your `optimisation' is usually at the algorithm level, rather than in some loop fragment. Maybe 10, even 5 years ago you could justify spending 2 days figuring out a better\faster way of lerping across a triangle but these days just don't bother. If the compiler can't max it out you will discover a problem when you profile your app and can fix it later. Remember that C++ gives you all of the C constructs and some. The lower level you code at the less chance the compiler will have to maximize and optimize your code. Just setting a little asm method in there inline can totally screw the compilers optimisation strategy, so don't bother.

velco
07-05-2002, 05:56 AM
Originally posted by Robbo:

No - ehem. These days your `optimisation' is usually at the algorithm level, rather than in some loop fragment.



Well, that's what kids in school think, IMHO.

Take a look at any contemporary performance comparison/benchmark/etc. The fight is for percents, not times, and definitely not for asymptotic differences. Of course, this is a no surprise, because everyone eventually comes to the best algorithm for the job and then the implementation details matter.



The lower level you code at the less chance the compiler will have to maximize and optimize your code.


Please, take a look at this thread in comp.graphics.algorithms http://groups.google.com/groups?dq=&hl=e...40eml.cc#link25 (http://groups.google.com/groups?dq=&hl=en&lr=&ie=UTF-8&frame=right&th=38850646dddf6185&seekm=3D0F8491.3000805%40eml.cc#link25)
to see what a low level coding can give you.

I hereby challenge everyone to come with a faster C++ (or C for that matter) solution http://www.opengl.org/discussion_boards/ubb/smile.gif


Just setting a little asm method in there inline can totally screw the compilers optimisation strategy, so don't bother.

With most compilers, yes. But certainly not the case with, e.g. GCC inline assembly where the compiler itself assign registers to the assembly block and basically knows everything about it.

Regards,
~velco

07-05-2002, 04:10 PM
If you want to learn C++ is Thinking in C++ 1&2 two good books available for free download. The author recommends Borlands compiler and it can be downloaded from Borland. Remember that both OpenGL and C++ is big so do not underestimate the difficulties.

Here is the link to the books: http://www.mindview.net/Books/TICPP/ThinkingInCPP2e.html

Robbo
07-06-2002, 12:39 AM
Originally posted by velco:
With most compilers, yes. But certainly not the case with, e.g. GCC inline assembly where the compiler itself assign registers to the assembly block and basically knows everything about it.

Regards,
~velco

Lol! It really doesn't make a hell of a a lot of difference.

(1) If you want to get the job done - would you spend 8 hours getting an 18% speedup on Foo, or just write a reasonable Foo and maybe optimise it if the results weren't good?

(2) How portable is code optimised to take advantage of the strategy used by some given compiler (x)? Not very.

(3) Even though GCC knows about register assignments inline ASM, it doesn't make a fig of difference because x86 processors don't have a whole lot of registers in the first place.

ioquan
07-06-2002, 10:43 PM
The difference in performance between c and c++ is so small that I cant see why anyone would want to use c. 3D engines, probably more so than any other type of program, lend themselves particularly well to object oriented deisgn. C++ will help you get your project done a lot quicker, and help you manage complexity. Those advantages outweigh the slight performance advantage of C by far.

I have been working on an engine for the last few months, and I know I wouldnt be anywhere near where I am now if I had used c instead of c++.

[This message has been edited by ioquan (edited 07-07-2002).]

CopyCat
07-07-2002, 01:22 AM
This means that you do not know C good http://www.opengl.org/discussion_boards/ubb/smile.gif
Now coding in C++ is quicer - a myth.
The time spent on developing the apps is similar.
But time of analysis for OOP project is a lot
longer then with structural aproach.

( I mean a good analysis...not some like think what I want to do, sit down and code http://www.opengl.org/discussion_boards/ubb/smile.gif

velco
07-07-2002, 02:38 AM
Originally posted by Robbo:
Lol! It really doesn't make a hell of a a lot of difference.


Lol! 18% or 33% is a HUGE difference. Do you really think the rest of the world is so stupid that you can always beet them by more than 18 or 33 percent ?



(1) If you want to get the job done - would you spend 8 hours getting an 18% speedup on Foo, or just write a reasonable Foo and maybe optimise it if the results weren't good?


Yes http://www.opengl.org/discussion_boards/ubb/smile.gif

In the real world, quite often what matters is to be on the top, even by a 1% margin http://www.opengl.org/discussion_boards/ubb/smile.gif




This is so broad statement that it bears no semantics.

That's not the point, of course, the point is that low level coding allows you to perform optimizations at the source level, which are advantageous due to the factr that the programmer generally knows more about the program than the compiler.


[B]
(3) Even though GCC knows about register assignments inline ASM, it doesn't make a fig of difference because x86 processors don't have a whole lot of registers in the first place.

Not true.

When the compiler can assign inline ASM registers it is able to: a) avoid unnecessary moves by allocating the register where the value already is, b) avoid unnecessary moves, by allocatins output value to the register that is its ulitimate destination, c) avoid unnecessary saves/restores around the inline ASM, since it knows particular registers are not modified, d) avoid unnecessary saves/restores around the inline ASM, since it knows that particular memory locations are not written, guess there are more.

As for the number of registers, 8 XMM + 8 MMX + 6 GPRs, while not a hell of a registers, are still a pretty decent amount.

Regards,
-velco


[This message has been edited by velco (edited 07-07-2002).]

07-07-2002, 04:35 PM
Two things to have in mind then using C++:
1. Working bottom-up by first identifying the classes and then implement functions for all possible cases can produce big and bloated code.
2. Using dynamic memory for all objects can be slow compared to the big array approach that C programs often takes.

Robbo
07-07-2002, 11:43 PM
If you were right, then perhaps everybody would still be using C, and C++ wouldn't be so popular.

As for speed, once again, I see no noticable difference. Would you like to give me an example of code I can write that is much faster in C than C++? Something meaningful, not just some obscurity.

If you want real speed, I guess you should write your code in all-assembler - why don't you? Perhaps because erm, C offers more convienience - and for a lot of us C++ offers even more.

Writing code in C that is `modular' often requires the use of C++ constructs in any case, so why bother typing more? (at least). You have to write a constructor for your object (probably called xxx_init), you have to pass pointers into your `member' methods ( xxx_init ( xxx *pThis ) ), etc. Whats the point? Some religious reason? I've coded in ASM, C, C++ (in order of bugginess).

Can you use the STL with C? No? Have you written your own STL? Why?

Robbo
07-07-2002, 11:47 PM
Originally posted by Zico:
Two things to have in mind then using C++:
1. Working bottom-up by first identifying the classes and then implement functions for all possible cases can produce big and bloated code.
2. Using dynamic memory for all objects can be slow compared to the big array approach that C programs often takes.

You don't have to use dynamic memory with C++ programs - you can use big arrays (and most do).

You don't have to work top-down or bottom up - you can write a very simple vector class and then you can write your application object. As for code `bloat' - having a `complete' class makes it more reusable. In your case, whenever you need a new operation on an object, of course you write one! So do C++ programmers!?! C++ has not syntactic prerequisite that you must write a `complete' implementation for any given object. In the case of `vector', I made it complete because I knew in advance that all of the methods made available would eventually be used.

rhmazza
07-08-2002, 08:16 AM
It seems like all the arguing really is just to make people feel better about themselves... because what's going on is that everyone wants to be able to justify the language they prefer, and also probably know better than the other (and subsequently feel intimidated by people with the contradicting opinion because they know the other language better).

They both are used widely and have their positives and negatives. There will always be ways to put down someone with an opposing opinion. You know what the best language is between C and C++? THE ONE YOU LIKE BEST. That's all there is to it. You will be quicker and more efficient with it, and happier (alhthough you should be familiar with both).

lsdi
07-09-2002, 10:28 AM
C++ its great. But some interresting on graphic engines:

quake 1,2: C
unreal: C
gta 3: C
Max Payne: C

All hardcore calculations on engine arent using c++ classes, objects etc. GUI things are almost always built in MFC (c++), ATL, or over opengl context.

ioquan
07-09-2002, 11:39 AM
Half-Life: C++

Maxmagnus
07-10-2002, 06:53 AM
Hi to All,
This might not be at all topic
of this dicusion but since I am
new in gl I had to ask.
Someone mentoned that using
the GLUT (and 1 other lib) is not
that good if u r to realy know gl.
Why is that?
maxmagnus

velco
07-10-2002, 09:44 AM
Originally posted by Robbo:

If you were right, then perhaps everybody would still be using C, and C++ wouldn't be so popular.


Well, I did a quick search for "programming language popularity". Here are the results:

C: 2673
Perl: 1361
C++: 1020
PHP: 740
Java: 726
Python: 403
Unix Shell: 246
Tcl: 190
SQL: 124
Other: 89
JavaScript: 85
Assembly: 83
Other Scripting Engines: 41
Lisp: 35
Scheme: 35
Ruby: 31
Objective C: 26
PL/SQL: 21
Fortran: 18
Eiffel: 16
Delphi: 15
Ada: 15
ML: 15
Pascal: 15
Awk: 13
Zope: 13
Forth: 11
ASP: 9
Emacs-Lisp: 9
Haskell: 8
Cold Fusion: 7
Visual Basic: 6
Modula: 5
Rexx: 5
Dylan: 4
Erlang: 4
Object Pascal: 4
APL: 3
Smalltalk: 3
PROGRESS: 2
Prolog: 2
Simula: 1
XBasic: 1
Euler: 1
Euphoria: 1
Basic: 1
Logo: 0

Now, I absolutely do not support that some thing's popularity is a measure for its merit, I'm just pointing out that you argument is completely bogus.

IMHO, part of the popularity of C++ is due to the fact that it indeed saves typing, i.e. programming time, and, of course, pointy-haireds promote C++, because thay care for for the wages they pay, not for the **** their staff delivers http://www.opengl.org/discussion_boards/ubb/wink.gif



As for speed, once again, I see no noticable difference. Would you like to give me an example of code I can write that is much faster in C than C++? Something meaningful, not just some obscurity.


You'll see difference only after you open your eyes http://www.opengl.org/discussion_boards/ubb/smile.gif Not by declaring facts, which do not suit you thery insignificant, obscure, etc.



If you want real speed, I guess you should write your code in all-assembler - why don't you? Perhaps because erm, C offers more convienience - and for a lot of us C++ offers even more.


Or perhaps because C offers often the same performance and the portabiluty comes as extra bonus.



Writing code in C that is `modular' often requires the use of C++ constructs in any case, so why bother typing more? (at least). You have to write a constructor for your object (probably called xxx_init), you have to pass pointers into your `member' methods ( xxx_init ( xxx *pThis ) ), etc. Whats the point? Some religious reason?


The point is, e.g, not calling the constructor when it is not needed.


Can you use the STL with C? No? Have you written your own STL? Why?


Huh? What kind of argument is that? Of course, I've written my own hash tables, AVL-trees, red-black trees - all customized for my specific use. Did I spent more time than just writing "std::map<foo,bar,baz>" ? Sure. Did my program took less space, less compile time, less run time? Definitely.

And, of course, there's GLIB.

And as a final post to this thread, I'll repeat myself a little:

C++ has only slightly lower performance inherently, the problem is in the programmer, in that it is harder to write an efficient program in C++, to the large extent due to the fact that stuff that happens is not apparently visible from the source code, i.e, an innocent "a = b + c" could well translate to a single insn or to gross overloaded operator invocations and you have to look up an arbitrary amount of other sources (in this case, where "operator+" is defined) in order to figure out what that simple statement does.

~velco

07-11-2002, 09:25 PM
Maxmagnus, I think he wrote that you can not use GLUT if you want to make a Direct3D port. He also belives that they support dumbness. My advice is simply to ignore comments like that.

Robbo
07-11-2002, 11:58 PM
Your quick search for programming language popularity is itself bogus. That result is only for open source projects posted up on source forge. Hardly representative of the real world. At my present company, only the driver writers use C (and sometimes at that) - we use VB and C++ for all our other work. At the video game company I worked for before that, everyone used C++ (VC++) - with D3D - and when I worked for a University writing a Neural Network simulator, the project was written in C++.

C is much quicker, I just have to open my eyes! Thats a quite hilarious argument - give me an example so I can check compiler ASM output and see if your argument is indeed true.

As for operator overloading and having to check sources - it is clear that when I'm adding two non-basic types, I am calling an operator overload:

void Foo ( vector v1, vector v2 )
{
vector res = v1 + v2;
....
....
....
}

I know that v1 and v2 are vectors and that adding vectors is only possible if operator overloads are used. So what is your point? I have to actually know what type v1 and v2 are to use the + operator? Good programmers sometimes know what types they are adding! Still not convinced?

Is C better than C++? C has less language features than C++, often produces more buggy code (reduced type safety) and is harder to maintain.

Oh and by the way, if you don't want to call a constructor on an object then leave it empty - the compiler will optimise it away in any case.

07-12-2002, 07:06 AM
ok so the post started off 'what should I use' and now has denigrated to 'my preferred tool is better than yours'. What we're seeing is a lot of people passing off what seem to be inherently biased opinions based on who they are, where they're from, and what they've done. "You can't accurately observe if you're experiencing" seems to nbe a truism here.
I'm just learning opengl and objective-C. Why this combo? because the MacOsX developer tools are ready to go in this format, you go get the glut, plug it in, goto nehe.gamedev.net and get the tutorial, open it up in whatever the developer apps is called in macOSX and off you go. Every one's going on about ease of use, managing projects, understanding code, optimisation etc. But really i don't care whether i've chosen the wrong language or if I'm cutting myself off from a 'deeper understanding' or whatever. What I do understand is that all of the things i'm trying to do are to do with objects and the state they are in at any one time(do they examine themselves?). In 10 minutes i'm up and running and i've never written a line of code before in my life. Not only that but object-C looks like objects, especially when Syntaxed in the IDE.
So i 'see' these objects in the source. I get a feel for the state machine nature of opengl and _then_ I have opinions about is this the leanest meanest hack? will it work on everything equally well? Is this a problem of conceptual understanding or actual programming understanding? What are the implications of my compiler, language, platform.
In a nutshell it's what gets you going fastest, and that is a personal thing, i tend to play with lots of different things until i suddenly realise that i've forgotten about the other options 'cos i've found a methodology or GUI layout that i dig.