Thread: turbo? clean? basic? Is C still a contender?

  1. #31
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    Care to elaborate how most of what you've just posted will work in a protected mode enviroment?

    Also isn't your explanation a over-simplification of how OpenGL and DirectX work? I don't believe either of them were primarily designed to create software renderers. Even alot of the GUI (non-3d) api calls are implemented in hardware, and accessed via the driver.
    Exactly. This is a HUGELY oversimplified example. For that matter,
    in just "plain C", you are NOT going to end up with super graphics
    engines.

    Quake has assembly in it. I'd be really surprised to learn that
    most (all?) 3D engines are written without any assemly. I really
    doubt that is the case.

    Furthermore, libraries such as OpenGL, DirectX, etc, likely have
    assembly in them also.

    I doubt that you can do "anything" in C. For the kernel and drivers
    of the OS, as with graphics engines, I'd be VERY surprised to see
    it done in "pure C" with no assembly.

    While you "may" be able to do it, this is in no way saying that it
    is a "GoodThing(TM)" to do so. Again, without using assembly,
    your graphics, while it may be possible to do so, are NOT going to
    be up to par with Quake.

    Quzah.
    Hope is the first step on the road to disappointment.

  2. #32
    S­énior Member
    Join Date
    Jan 2002
    Posts
    982
    >Furthermore, libraries such as OpenGL, DirectX, etc, likely have
    assembly in them also.<

    There probably is. But alot the hard work is done in hardware, neither C or assembly would be required. Direct X's software implementation of stuff not available in hardware is by all accounts not that good, and in an environment where hardware accelerators are widely available (and required for most modern games) could almost be seen as an after thought.

    The assembly in Quake is predominately there to provide a very fast software renderer. However, even this software renderer uses a DirectDraw surface to enable it to easily access the video memory to draw onto.

  3. #33
    Sayeh
    Guest
    Oh God, forgive them for the know _nothing_...

    I'm sorry, I'm going to blow a gasket, just a bit (I'm approaching 70, I can do that, you know)--

    I could swear, I could be flabbergasted, I could just positively throw my hands up in the air and scream at your _IGORANCE_. Quzah I am positively _ashamed_ at your comment. Un_believable_.

    What do you people think C code becomes? What do you think ANY COMPUTER LANGUAGE IS CONVERTED TO, FOR THAT MATTER.... ASSEMBLY LANGUAGE! That is what your compiler is for, for crying outload. Do you think your computer runs 'C' code? sheesh.

    'C' is nothing more than a language, like english or spanish that you use to talk to your COMPILER. Not the computer.

    I stated my pseudocode example was not written for performance. It was written as an example to give people an idea how it's done. That's why virtually none of you have done it, because you've never even gotten _this_ far.

    Of course, the real thing would use custom assembler because it's tighter than what the compiler would generate, but most people on this board don't know assembler, and if you really wanted to see it that way, it would have taken a _lot_ longer to provide. You ever wonder why C has so few "built-in" functions and commands-- it's just the basics-- so it CAN BE PORTABLE. That's all you need to write the rest. What more do you need?

    Yes, what I showed is for a software renderer, and _yes_ hardware is always faster. I could cover how your video _accelerator_ works, but that is _way_ over your heads.

    I guess part of your problem is that you all have never understood that what you write in software, is actually TTL Hardware logic... IN SOFTWARE.

    What did you think is on the ROMs on your processor or video chips? I designed chips for a living. I helped design Intel's 4004 (the original chip) and others.

    ----

    The real problem is that all but 6-7 (they haven't posted in this thread by the way) of you have failed to master the language (whether it's 'C' or any other). You still struggle with the basics of syntax and grammar, and scope, and will never actually do great things with the computer. You just can't seem to get past this obstacle.

    I am exceedingly frustrated because I just can't seem to find the point of view that will open your eyes.

    Because you just can't seem to understand it, you try to tear it down, instead of thinking about it and correlating what you learn. Very frustrating.

    That's really the difference between people who have to figure out how to make do with what they have, and people who need everything handed to them because they can't seem to figure it out on their own.

    I can't figure out why you guys can't learn this! Stop being so damn narrow minded. Stop pretending you even have a grasp on how this stuff works. Instead of always saying 'well, you can't do x because (of some erroneous assumption about how it works)', why don't try 'if that's so, then how does...x... work?'.

    I don't know. I'm about ready to give up trying to give you guys a boost on this stuff. it would be so different in a face-to-face environment where I could draw things and explain things and answer questions as they come up...

    What do you think? Should I bother anymore, or just go away?

    Quzah, again, I'm so shocked with your statement I would think somebody else wrote it... just, almost no words. You are _most certainly_ smarter than that.

  4. #34
    Registered User
    Join Date
    Mar 2002
    Posts
    18

    Whew!!!

    "What do you think? Should I bother anymore, or just go away?"
    Please don't go away!
    This thread has earned Stars!!
    I may not have the deep knowledge of C yet but I think we are all on to something in this thread...
    The truth is the truth no matter where one finds it.
    Alex

  5. #35
    S­énior Member
    Join Date
    Jan 2002
    Posts
    982
    >I am exceedingly frustrated because I just can't seem to find the point of view that will open your eyes

    Well posting some portable code that will work would be a start. Since it's all so easy it shouldn't be a problem.

    And since it's to be portable it should work in 32bit protected mode (at PL4) since that's what a significant proportion of the people learning to program on this board will be using (along with a significant proportion of GUI apps wrtten for the PC this century).

    Some concrete info, rather than a mindless rant would be much more beneficial for all involved.

  6. #36
    Just one more wrong move. -KEN-'s Avatar
    Join Date
    Aug 2001
    Posts
    3,227
    For what it's worth, in all the studying I've been doing to write my operating system (and a few random articles and interesting papers I've come across) I can whole-heartedly agree with Sayeh in everything that he's said...

    He's right y'know. Just sit back and think about things for a bit instead of trying to tear down what he's try to _teach_ you. Absorb the knowledge he so freely attempts to give you, don't block it out.

    I suggest you all read a few docs on how your computer works (in this case your video hardware) in all its aspects. That or strive to write your own O/S like me. You'll wind up learning enough low-level stuff to fill your entire harddrive and you wouldn't be making these silly arguments.

  7. #37
    S­énior Member
    Join Date
    Jan 2002
    Posts
    982
    Oh good another one. I know how my computer works, thankyou. You might like to check out "The Indispensable PC Hardware Book", by Hans-Peter Messmer. It's highly regarded and goes into far more detail than anything I've ever seen posted here.

    Where _am_ (wow, these underscores are fun) trying to tear down what Sayeh's trying to teach me. He stated that what he was posting was portable, it is clearly not. The original question was about an interactive game/planning tool, and to suggest that in order to do this you need to write an o/s or device driver is ludicrous.

    If you can produce some clearly portable C code to write a game/GUI app that doesn't call an API (and doesn't resort to "well you can write your own o/s"), then I'll happily eat my words.

    >you wouldn't be making these silly arguments.

    Nice one, now back up some of yours.

  8. #38
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    Originally posted by Sayeh
    [B]Oh God, forgive them for the know _nothing_...

    I could swear, I could be flabbergasted, I could just positively throw my hands up in the air and scream at your _IGORANCE_. Quzah I am positively _ashamed_ at your comment. Un_believable_.

    What do you people think C code becomes? What do you think ANY COMPUTER LANGUAGE IS CONVERTED TO, FOR THAT MATTER.... ASSEMBLY LANGUAGE! That is what your compiler is for, for crying outload. Do you think your computer runs 'C' code? sheesh.
    Gee, ya think? Of course it BECOMES assembly. There is a HUGE difference between "programming in C" and "programming in assembly". If YOU don't know the difference, then yes, you damn sure should be ashamed.


    'C' is nothing more than a language, like english or spanish that you use to talk to your COMPILER. Not the computer.

    I stated my pseudocode example was not written for performance. It was written as an example to give people an idea how it's done. That's why virtually none of you have done it, because you've never even gotten _this_ far.
    And as such, you missed my entire point:

    Writing a graphics engine in C is far different than writing one in assembly. There is a REASON they write parts of the code in C and write parts in ASM. If there was NO DIFFERENCE do you think they would bother doing it? Hell no they wouldn't.


    Of course, the real thing would use custom assembler because it's tighter than what the compiler would generate, but most people on this board don't know assembler, and if you really wanted to see it that way, it would have taken a _lot_ longer to provide. You ever wonder why C has so few "built-in" functions and commands-- it's just the basics-- so it CAN BE PORTABLE. That's all you need to write the rest. What more do you need?
    Thank you for making my point. Like I said: WRITING A GRAPHICS ENGINE IN C IS NOT THE SAME AS WRITING IT IN ASM.

    Quzah, again, I'm so shocked with your statement I would think somebody else wrote it... just, almost no words. You are _most certainly_ smarter than that.
    So what exactly was the horrible point of my post? Stating that your graphics engine isn't the same if you write it in C as in ASM? Again, if that were incorrect, why on earth would they even bother with ASM? Oh, that's right, I must have no clue...

    Quzah.
    Hope is the first step on the road to disappointment.

  9. #39
    Registered User foniks munkee's Avatar
    Join Date
    Nov 2001
    Posts
    343
    Let's see if I understand something:
    - C could write a graphics program.
    - There are no standardized graphics libraries in "clean" C.
    - There are third party graphics libraries.
    - If I write code using these libraries (or, even make that african gun) there is no guarantee that my executable will run on any given, specific computer????
    Just to answer your second point here regarding a standardised graphics library. Your best bet is OpenGL. The libraries have a standard interface across many different platforms. It works in straight C - although of course you are calling the OpenGL library and not C functions. The OpenGL library itself is written primarily in C, but I believe that the implementation is hardware/OS specific. For example, Microsoft provide their own implentation under windows.

    If you are not looking for high performance, you could use the GLUT libraries. It is essentially an OpenGL wrapper that goes a long way to creating an OS independant library. For example the call to create a window is exactly the same under Windows as it is under Solaris or Linux, GLUT takes care of the behind the scenes work.

    As far as game development goes, most games are written in C with either DirectX or OpenGL being the most common graphics API. It used to be that some developers would claim that C++ doesn't have the performance, but from the Gaming press I can see that the use of C++ is growing all the time - but I have not seen a game programming job todate that does not require C as the main skill.
    If you can produce some clearly portable C code to write a game/GUI app that doesn't call an API (and doesn't resort to "well you can write your own o/s"), then I'll happily eat my words.
    Your dead right. You can't - you need to use an API if you want to get performance and portability. OpenGL is the only truly portable API that is supported directly in hardware on most standard video cards which is why ID software use it.
    Last edited by foniks munkee; 03-30-2002 at 06:44 PM.

  10. #40
    Just one more wrong move. -KEN-'s Avatar
    Join Date
    Aug 2001
    Posts
    3,227
    You can, just so long as you retrieve the address space you should write to from your OS. Ok, ok, so no code is completely portable. You just have to recompile for different platforms.

  11. #41
    S­énior Member
    Join Date
    Jan 2002
    Posts
    982
    >You can, just so long as you retrieve the address space you should write to from your OS.

    Sorry, not portable. I suggest you look up what the IOPL flag does in your library of low level stuff.

    >You just have to recompile for different platforms.

    That's binary portabilty, we're talking about C code portability. You have to do more than re-compile.

  12. #42
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,897
    I debated whether or not to respond to that scathing post of yours Sayeh. In the end, my being insulted won out over objectivity.

    >Because you just can't seem to understand it, you try to tear it down,
    >instead of thinking about it and correlating what you learn.
    >Very frustrating.
    It's also very frustrating how you simply assume that we aren't trying to understand at all. I'll describe my posts because those are the only ones I'm sure of. I believe I answered a question to the best of my knowledge and as usual expected someone to correct me if I was wrong. When I found out that I apparently was wrong, I requested more information so that I could learn. Then you show up saying that we're so ignorant and why can't we understand something that you've worked with most of your life? I'm sorry, you may be approaching 70, but common courtesy doesn't have an age limit.

    Could you tell me what is the difference between your last post and someone who comes onto these boards bashing novices just because of their lack of experience? I'm sorry If I'm not 50 years older and started working with computers at the time of the 4004 chip. So I ask you, please respect the fact that we are not as knowledgeable as you, but we are trying.

    -Prelude
    My best code is written with the delete key.

  13. #43
    Just one more wrong move. -KEN-'s Avatar
    Join Date
    Aug 2001
    Posts
    3,227
    >>and why can't we understand something that you've worked with most of your life?

    Hear hear...I was neglecting the apparent bashings of sayeh in my previous posts in order to try and keep things a bit more on-topic, but I do agree with that.

  14. #44
    Registered User
    Join Date
    Mar 2002
    Posts
    18

    ~ Respect for Weirditity~

    First:
    Thanks to foniks munkee for the tip on OpenGL
    Second:
    I've been on many boards in my time and I've seen flame wars and huge tidal waves of disrespect; also, some of the best and most educational threads ever. This one, however, is some weird combination of a war about to happen and a high-level interchange of stimulating ideas. (I am a newbie to C but not to life and the psychology of this thread is fascinating)
    Third:
    C must be something _real special_ because I really like this board and its people, in spite of the obvious character flaws in this thread. (are mine showing?)......
    Alex

  15. #45
    Just one more wrong move. -KEN-'s Avatar
    Join Date
    Aug 2001
    Posts
    3,227
    >>C must be something _real special_

    It really is...

    >>because I really like this board and its people

    >>in spite of the obvious character flaws in this thread. (are mine showing?)......

    pobody's nerfect Plus, normal people would make for rather boring discussion, dontcha think? And yes, I'd have to say yours would be that you're a smartass

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 10
    Last Post: 11-23-2007, 12:13 AM
  2. Remember Turbo? It is comming back
    By Mario F. in forum A Brief History of Cprogramming.com
    Replies: 1
    Last Post: 08-14-2006, 01:26 PM
  3. [ANN] New script engine (Basic sintax)
    By MKTMK in forum C++ Programming
    Replies: 1
    Last Post: 11-01-2005, 10:28 AM
  4. what are your thoughts on visual basic?
    By orion- in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 09-22-2005, 04:28 AM