Why C instead of C++?
Just wondering why C tends to be used more with OpenGL than C++?
Is there an advantage? More efficient or something?
Just curious.
"If all else fails, lower your standards."
Hi,
That is a misconception.
If you look at Opengl game programming books code - its mostly C++. I guess previously as many were used to C, so most books like The red book, the superbible have used C.
That is a misconception.
If you look at Opengl game programming books code - its mostly C++. I guess previously as many were used to C, so most books like The red book, the superbible have used C.
Hello from my world
maybe c is a more suitable one which can be accepted by all kinds of platform,u know,most systems r based on C.
just a inference.
jerry2
jerry2
Programming,make a whole new world.
just a inference.
jerry2
jerry2
Programming,make a whole new world.
jerry2The God creates the world, the world creates the nature,the nature creates human. Human create...Everything.
May 11, 2002 07:49 AM
That is wrong. C is more used in opengl tutorials and little samples for simplicity, nothing more.
One goal of OpenGL is to make a 3D API that runs on nearly any kind of toaster you operate, from Windows to Mac to Linux. To add to this, it''s also programmed in C, so both C programmers and C++ programmers can take advantage of it. It just makes the world a better place having it work in conjunction with C and C++.
Why not? 
C compiles faster and to more compact code, I think it is much cleaner and simpler too.
I think that C executes faster than C++ but maybe that''s because of simpler data structures requiring less code to be executed.
But just try to do dynamic binding with c!

C compiles faster and to more compact code, I think it is much cleaner and simpler too.
I think that C executes faster than C++ but maybe that''s because of simpler data structures requiring less code to be executed.
But just try to do dynamic binding with c!

omfg, Why dont you guys read the definition and histories of C and C++, C++ is C but with OOP (Object Oriented Programming) implimented. It also allows developers to utilize more features than C.
And Personally I dont care if my C++ Code compiles slower than your C code, because I am not that impatient. also, with the right settings, and optimizations you can get your C++ code to compile smaller. Just like in VB you can set all kinds of optimizations for small code, fast code, pentium code, and what ever.
So this discusionis more like which came first, the chicken or the egg (which was the egg because chickens evolved from reptiles)
And Personally I dont care if my C++ Code compiles slower than your C code, because I am not that impatient. also, with the right settings, and optimizations you can get your C++ code to compile smaller. Just like in VB you can set all kinds of optimizations for small code, fast code, pentium code, and what ever.
So this discusionis more like which came first, the chicken or the egg (which was the egg because chickens evolved from reptiles)
IIRC - OGL was developed by SGI. SGI ran Unix. C is the language of choice for Unix. Perhaps also when OGL was developed C was more widely used than C++. C++ has picked up more steam in the last few years and C has lost ground - which is why a question like this would have been absurd 5 years ago but isn''t today.
"I thought what I'd do was, I'd pretend I was one of those deaf-mutes." - the Laughing Man
May 11, 2002 03:48 PM
quote:
Original post by stefu
Why not?
C compiles faster and to more compact code, I think it is much cleaner and simpler too.
I think that C executes faster than C++ but maybe that''s because of simpler data structures requiring less code to be executed.
But just try to do dynamic binding with c!![]()
Myth, Myth, Myth. Test it and you''ll see, they''re the same speed.
quote:
Original post by stefu
C compiles faster and to more compact code...
This is FUD.
quote:
I think it is much cleaner and simpler too.
This is opinion.
quote:
But just try to do dynamic binding with c!
This is ignorance. Consider that early C++ compilers were written in C - some of them simply as preprocessors to a C compiler.
quote:
Original post by _Titan_
omfg, Why dont you guys read the definition and histories of C and C++, C++ is C but with OOP (Object Oriented Programming) implimented. It also allows developers to utilize more features than C.
This is misconception (and why only reading histories is useless). C++ started out as "C with classes" but has since grown into its own language, such that sometimes legal C wont compile in C++.
And then there''s modern C++...
Anyway, LessBread hit it on the head. OpenGL comes from a UNIX heritage, and UNIX is intrinsically tied to C, even now. Since OpenGL predates widespread adoption of C++ (in the form of IRIX GL, etc), it''s only logical that its examples were made in the predominant language of the time.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement