Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Page 1 of 2 12 LastLast
Results 1 to 10 of 19

Thread: Is C dying?

  1. #1
    Junior Member Newbie
    Join Date
    Apr 2002
    Posts
    6

    Is C dying?

    1)Is C dying?
    2)Can you find job in the game community only with C knowledge and OpenGL?
    3)Why more and more games are using DX instead of OpenGL?
    Since I am new to game development I am asking these questions so that I have a grasp of reality.

  2. #2
    Intern Contributor
    Join Date
    Nov 2002
    Posts
    96

    Re: Is C dying?

    1)
    Looking at desktop applications then you'll see that C is used less frequently than C++ (or C#, for as much as it's being used). But dying? no!
    C is often used in embedded applications and speed-critical applications. C,s advantage over C++ is still that it's a bit faster due to less overhead of the objects.

    2)
    Well, I've never come into contact with the gameindustry, i'm merely a student, but from what I've read is that more and more games are using C++. The advantages of OO design are often greater that the disadvantages.
    Learning C++ would be a good move, so I have been told.

    3)
    I have no experience with DirectX, but I think it's because most games are aimed to work under Windows, not cross-platform. I think I read somewhere that OGL is losing terrain to DirectX technology-wise, but don't quote me on that as I'm not sure.

  3. #3
    Senior Member OpenGL Guru
    Join Date
    Feb 2000
    Location
    Sweden
    Posts
    2,982

    Re: Is C dying?

    1) It may be loosing, but not dying. C is still a very good language for low-level programming, microcontrollers for example.

    2) No answer from me here, not enough experience on the topic. But I would be surprised if the answer is no.

    3) Do you really mean to compare DirectX, a full feature multimedia library containing components for graphics, sound, music, input, network, with a pure graphics API? It's pretty obviuos why DirectX is more used that OpenGL; it has WAY more features. Games that uses OpenGL also, generally, uses DirectX for stuff that OpenGL does't provide, like input and sound.

  4. #4
    Senior Member OpenGL Guru
    Join Date
    Feb 2000
    Location
    Sweden
    Posts
    2,982

    Re: Is C dying?

    C,s advantage over C++ is still that it's a bit faster due to less overhead of the objects.
    What kind of overhead?

  5. #5
    Intern Contributor
    Join Date
    Nov 2002
    Posts
    96

    Re: Is C dying?

    As far as I know objects are still managed in the compiled code by an object manager. Also can the construction and destruction of objects be hard on a system.
    Ofcourse, you won't notice on your AMD XP<insert big number>+ or P4 but when working on embedded systems with processors with a few Mhz and little RAM you don't want a lot of useless overhead that are brought in by a object manager and object overhead. In such a case every byte counts

  6. #6
    Senior Member OpenGL Guru
    Join Date
    Feb 2000
    Location
    Sweden
    Posts
    2,982

    Re: Is C dying?

    I have codede C++ for quite some time, and I have never heard of any "object manager". And if there is, there is one in C too, cause I have never seen any (major) difference in machine code compiled from similar C and C++ code.

    As for constructors and destructors, if you need the same functionality in C, you will get the same performance hit when calling your own function to initialize and deinitialize an object. Say you need all new object to be initialized. In C++, you use a constructor. In C, you use a regular function (or a macro, or whatever). In the end, the result is the same, a function call to initialize the object. If you don't need to initialize an object, there's no reason to implement a complex contructor either.

    The difference in speed between C and C++ is not the language itself, but the way you use it. It is possible to write slow code in C++, and it's also possible to write slow code in C. It just depends on how you use it.

  7. #7
    Junior Member Regular Contributor
    Join Date
    Nov 2002
    Location
    Minnesota, US
    Posts
    180

    Re: Is C dying?

    Hey Antony,

    1) No C isn't dying at all. A lot of people use C on this forum and in jobs that involve programming drivers or many low level things.

    2) I have no idea about this one! By like Bob said, I'd be really shocked if the answer was no. With specifically game programming, it may be kinda hard. But if you are just looking for graphics programming, it is a possibility to find a job using C and OpenGL. I'm a college student so this is all speculation!

    3) Well, DX is an API made to program games. It has it's own model support & it has parts for sound, input, etc. OpenGL only provides the most basic procedure you need plus a few useful ones in the utility library. DirectX provides users everything they need to start making a game.

    - Halcyon
    "Programming is an art form that fights back."

    - I forgot who said it!

  8. #8
    Junior Member Newbie
    Join Date
    Jan 2003
    Location
    Queens, NY
    Posts
    11

    Re: Is C dying?

    well if you are going it alone and money is a big startup concern know that opengl works just swell with mingw and the mingw C compiler is much faster than the c++ compiler. Also, a lot of the advantages of c++ deal with working in groups(usually large) and 500,000+ line programs. C has a bit less stuff to learn. But if you are worried about a job just think of the fact that TONS of development houses use 3D Studio Max when there are definately(no one here can argue about this because this is a fact) better modelers out there. Why do they use it? Because that is what everyone in the field knows. There are a lot more 3d studio max uses than Maya. So with programming its kind of the same deal. If you want a job follow the herd, because the herd will be the ones hiring you.
    1. learn C++ not C
    2. learn DirectX
    But if you are DIY C and Opengl are what i use.

  9. #9
    Junior Member Newbie
    Join Date
    Dec 2002
    Location
    Las Vegas, NV, USA
    Posts
    9

    Re: Is C dying?

    To Bob -

    I agree with you completely that the preformance of C++ as compared to C completely depends on your intelligent use of the language, but from my experience there is an additional overhead that is always there in C++ if you're taking advantage of the features of the language that give it its boost over C. This may be a negligible overhead in the case of modern PCs, but with many embedded devices you're much more limited in all areas... in cases like this I do believe it may make a difference to use C over C++.

  10. #10
    Member Regular Contributor
    Join Date
    Nov 2000
    Location
    Sydney, NSW, Australia
    Posts
    426

    Re: Is C dying?

    If your extremely knowledgeable about C but know nothing about C++ consider this: all the knowledge of C can be applied in C++. C++ is just C with oop elements such as templates and classes and inheritance. The majority of the code is still C based.
    :: Sleep is a poor substitute for caffeine ::

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •