Direct X

ChronoChrono Local flyboy Join Date: 2003-08-05 Member: 18989Members
<div class="IPBDescription">what is it exactly?</div> can some one explain to me what exactly direct x is and what it does?

sorry i feel like a nub <!--emo&:(--><img src='http://www.unknownworlds.com/forums/html//emoticons/sad-fix.gif' border='0' style='vertical-align:middle' alt='sad-fix.gif' /><!--endemo-->

Comments

  • [WHO]Them[WHO]Them You can call me Dave Join Date: 2002-12-11 Member: 10593Members, Constellation
    DirectX is what is known as an "abstraction layer"

    It lets software programmers take advantage of hardware features without knowing how each video card works.

    It's a far step above the old days where games like the original doom had to have things like their sound interface setup differently for each different sound card.

    So basically, DirectX helps software talk to hardware.
  • RustySpoonRustySpoon Join Date: 2003-07-10 Member: 18069Members
    I didn't feel like starting a new thread, so I'll ask you guys.

    What's the difference between Displacement mapping and Parallax/Virtual displacement mapping?
  • DOOManiacDOOManiac Worst. Critic. Ever. Join Date: 2002-04-17 Member: 462Members, NS1 Playtester
    [WHO]Them is correct. Here is an alternative, less technical explaination:

    You see, all the inner workings of parts are different. Most apparently this is the case in 3D GPUs, but also in sound cards, modems, etc. Back in the old days (10-12 years ago) when a PC game was made the programmers had to specificaly code in their own "driver" (for lack of a more technical term) for each and every sound card. While it may have all been different, there were little differences that made it a pain in the butt.

    Also there was a problem with the new Windows 95 which it inherited from Windows 3.1 of being rather slow when it came to talking to a computer's hardware. There were several different windows

    So DirectX does two things:
    1) Most importantly, it provides a standard way for game programmers to program talking to DirectX to make a sound, and DirectX handles all the crap of individual differences in hardware. This saves the game developer a ton of time (and money) as they no longer have to do this themselves, plus it makes learning easier when there is a standard of how things are done. As long as the hardware has drivers that support DirectX as it should, then everything should be peachy keen and full of rainbows & smiles.

    2) Secondly, DirectX is a hell of a lot faster than the regular Windows instruction paths, so the speed at which Windows can talk to the hardware is significantly faster. Its not without reason to say that without DirectX, Windows would be far too slow to use as an OS for games.

    So there you go, DirectX in a nutshell.
  • coriscoris Join Date: 2003-07-08 Member: 18034Members, Constellation
    Whats the difference between OpenGL and DirectX then, except the fact that OpenGL is not OS-dependent as DX is.
  • Soylent_greenSoylent_green Join Date: 2002-12-20 Member: 11220Members, Reinforced - Shadow
    edited August 2004
    <!--QuoteBegin--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> </td></tr><tr><td id='QUOTE'><!--QuoteEBegin-->1) Most importantly, it provides a standard way for game programmers to program talking to DirectX to make a sound, and DirectX handles all the crap of individual differences in hardware. This saves the game developer a ton of time (and money) as they no longer have to do this themselves, plus it makes learning easier when there is a standard of how things are done. As long as the hardware has drivers that support DirectX as it should, then everything should be peachy keen and full of rainbows & smiles.<!--QuoteEnd--></td></tr></table><div class='postcolor'><!--QuoteEEnd-->

    I think Microsoft makes and enforces a standard for each DX interface that hardware manufacturers must adhere to both when designing hardware and when writing the drivers. MS can do this because they are freakin' huge. It's all the same to the end users.

    <!--QuoteBegin--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> </td></tr><tr><td id='QUOTE'><!--QuoteEBegin--> Whats the difference between OpenGL and DirectX then, except the fact that OpenGL is not OS-dependent as DX is.<!--QuoteEnd--></td></tr></table><div class='postcolor'><!--QuoteEEnd-->

    What to be implemented next is not governed by a single huge monolith of a company but by the OpenGL Architecture Review Board. It strives to be platform independant and vendor neutral. It's more open for discussion whats going to be implemented next, this is both good and bad, it makes it more sluggish as there tends to be much more discussion and less action. Microsoft can just force vedors to accept allmost any set of features in the next version in order to be classed as compliant(which vendors want to be), this can be a bad thing, but microsoft can decide on a new standard much quicker.
  • coilcoil Amateur pirate. Professional monkey. All pance. Join Date: 2002-04-12 Member: 424Members, NS1 Playtester, Contributor
    <!--QuoteBegin-Soylent green+Aug 21 2004, 09:34 AM--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (Soylent green @ Aug 21 2004, 09:34 AM)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin--> <!--QuoteBegin--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> </td></tr><tr><td id='QUOTE'><!--QuoteEBegin-->1) Most importantly, it provides a standard way for game programmers to program talking to DirectX to make a sound, and DirectX handles all the crap of individual differences in hardware. This saves the game developer a ton of time (and money) as they no longer have to do this themselves, plus it makes learning easier when there is a standard of how things are done. As long as the hardware has drivers that support DirectX as it should, then everything should be peachy keen and full of rainbows & smiles.<!--QuoteEnd--></td></tr></table><div class='postcolor'><!--QuoteEEnd-->

    I think Microsoft makes and enforces a standard for each DX interface that hardware manufacturers must adhere to both when designing hardware and when writing the drivers. MS can do this because they are freakin' huge. It's all the same to the end users.

    <!--QuoteBegin--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> </td></tr><tr><td id='QUOTE'><!--QuoteEBegin--> Whats the difference between OpenGL and DirectX then, except the fact that OpenGL is not OS-dependent as DX is.<!--QuoteEnd--></td></tr></table><div class='postcolor'><!--QuoteEEnd-->

    What to be implemented next is not governed by a single huge monolith of a company but by the OpenGL Architecture Review Board. It strives to be platform independant and vendor neutral. It's more open for discussion whats going to be implemented next, this is both good and bad, it makes it more sluggish as everything has there tends to be much more discussion and less action. Microsoft can just force vedors to accept allmost any set of features in the next version in order to be classed as compliant(which vendors want to be), this can be a bad thing, but microsoft can decide on a new standard much quicker. <!--QuoteEnd--> </td></tr></table><div class='postcolor'> <!--QuoteEEnd-->
    It's not as terrible as you make it sound. That's the definition of a standard - something an entire industry conforms to for mutual benefit. It's why different railroad companies all use the same width of track... it's just smart business.

    In some cases, standards are forced or bullied upon involved parties. DirectX is a little like that, but the end result IMO is still overall good.
  • SoulSkorpionSoulSkorpion Join Date: 2002-04-12 Member: 423Members
    <!--QuoteBegin-coris+Aug 21 2004, 09:01 PM--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (coris @ Aug 21 2004, 09:01 PM)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin--> Whats the difference between OpenGL and DirectX then, except the fact that OpenGL is not OS-dependent as DX is. <!--QuoteEnd--> </td></tr></table><div class='postcolor'> <!--QuoteEEnd-->
    OpenGL is a graphics API only, whereas Direct X comprises Direct3D (what most people mean when they use the term "Direct X"), DirectInput, DirectSound and DirectPlay.

    In addition, OpenGL is (originally, usually) in C, whereas Direct X is in C++ (and in Mircrosoft's own bizzare code standard called Hungarian Notation). DirectX is object oriented, OpenGL is not. Imho, DirectX is a lot nastier to work with than OpenGL.
  • BlobbyBlobby Join Date: 2004-06-11 Member: 29234Members
    <!--QuoteBegin--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> </td></tr><tr><td id='QUOTE'><!--QuoteEBegin-->OpenGL is a graphics API only<!--QuoteEnd--></td></tr></table><div class='postcolor'><!--QuoteEEnd-->

    Yes, but there's OpenAL (audio library) also exists along with others in the "Open" series.

    <!--QuoteBegin--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> </td></tr><tr><td id='QUOTE'><!--QuoteEBegin-->Direct X is in C++<!--QuoteEnd--></td></tr></table><div class='postcolor'><!--QuoteEEnd-->

    Direct X uses C. Some extra functionality is provided for C++ in their "X" interfaces, but standard interfaces (which is all that is needed) are in C.

    <!--QuoteBegin--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> </td></tr><tr><td id='QUOTE'><!--QuoteEBegin-->Mircrosoft's own bizzare code standard called Hungarian Notation<!--QuoteEnd--></td></tr></table><div class='postcolor'><!--QuoteEEnd-->

    It's not bizzare, it's widely used. And I think you're a little confused... Hungarian Notation is a scheme for naming declared variables. Since DirectX does not declair variables for you, it isn't in ANY special notation unless you choose it to be that way.
  • SoulSkorpionSoulSkorpion Join Date: 2002-04-12 Member: 423Members
    <!--QuoteBegin--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> </td></tr><tr><td id='QUOTE'><!--QuoteEBegin--><!--QuoteBegin--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> </td></tr><tr><td id='QUOTE'><!--QuoteEBegin-->OpenGL is a graphics API only<!--QuoteEnd--></td></tr></table><div class='postcolor'><!--QuoteEEnd-->

    Yes, but there's OpenAL (audio library) also exists along with others in the "Open" series.<!--QuoteEnd--></td></tr></table><div class='postcolor'><!--QuoteEEnd-->
    That's neither here nor there.

    <!--QuoteBegin--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> </td></tr><tr><td id='QUOTE'><!--QuoteEBegin--><!--QuoteBegin--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> </td></tr><tr><td id='QUOTE'><!--QuoteEBegin-->Mircrosoft's own bizzare code standard called Hungarian Notation<!--QuoteEnd--></td></tr></table><div class='postcolor'><!--QuoteEEnd-->

    It's not bizzare, it's widely used. And I think you're a little confused... Hungarian Notation is a scheme for naming declared variables.<!--QuoteEnd--></td></tr></table><div class='postcolor'><!--QuoteEEnd-->
    I know what hungarian notation is. I maintain that it <i>is</i> bizzare unless you know what to look for. It's far from intuitive. Perl is also widely used, and it's no less bizzare <!--emo&:p--><img src='http://www.unknownworlds.com/forums/html//emoticons/tounge.gif' border='0' style='vertical-align:middle' alt='tounge.gif' /><!--endemo-->.

    <!--QuoteBegin--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> </td></tr><tr><td id='QUOTE'><!--QuoteEBegin-->Since DirectX does not declair variables for you, it isn't in ANY special notation unless you choose it to be that way<!--QuoteEnd--></td></tr></table><div class='postcolor'><!--QuoteEEnd-->
    That's true.
  • OttoDestructOttoDestruct Join Date: 2002-11-08 Member: 7790Members
    <!--QuoteBegin-Blobby+Aug 21 2004, 12:00 PM--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (Blobby @ Aug 21 2004, 12:00 PM)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin--> <!--QuoteBegin--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> </td></tr><tr><td id='QUOTE'><!--QuoteEBegin-->OpenGL is a graphics API only<!--QuoteEnd--></td></tr></table><div class='postcolor'><!--QuoteEEnd-->

    Yes, but there's OpenAL (audio library) also exists along with others in the "Open" series.

    <!--QuoteBegin--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> </td></tr><tr><td id='QUOTE'><!--QuoteEBegin-->Direct X is in C++<!--QuoteEnd--></td></tr></table><div class='postcolor'><!--QuoteEEnd-->

    Direct X uses C. Some extra functionality is provided for C++ in their "X" interfaces, but standard interfaces (which is all that is needed) are in C.

    <!--QuoteBegin--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> </td></tr><tr><td id='QUOTE'><!--QuoteEBegin-->Mircrosoft's own bizzare code standard called Hungarian Notation<!--QuoteEnd--></td></tr></table><div class='postcolor'><!--QuoteEEnd-->

    It's not bizzare, it's widely used. And I think you're a little confused... Hungarian Notation is a scheme for naming declared variables. Since DirectX does not declair variables for you, it isn't in ANY special notation unless you choose it to be that way. <!--QuoteEnd--> </td></tr></table><div class='postcolor'> <!--QuoteEEnd-->
    I thought hungarian notation was this:

    int main void {

    if (blahblah == blahblah) {

    }
    }

    Where you put the } after any statement instead of a new line.
  • [WHO]Them[WHO]Them You can call me Dave Join Date: 2002-12-11 Member: 10593Members, Constellation
    edited August 2004
    <!--QuoteBegin-OttoDestruct+Aug 21 2004, 12:51 PM--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (OttoDestruct @ Aug 21 2004, 12:51 PM)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin--> I thought hungarian notation was this:

    int main void {

    if (blahblah == blahblah) {

    }
    }

    Where you put the } after any statement instead of a new line. <!--QuoteEnd--></td></tr></table><div class='postcolor'><!--QuoteEEnd-->
    That's not the hungarian notation that I was briefed on.

    hungarian notation is mainly a set of naming conventions for variables and functions.

    Variables start with some standardized identifier so you can quickly recall what it's type is.

    Each word in the v/f name either starts with a capital letter or is separated by an underscore. The first word being capitalized is optional when not prepending the name with a type.

    examples:

    float fBlah;
    double fBlah;
    int iBlah;
    unsigned int iBlah; (some people use ui, but I think they're nuts)
    bool bShieldsOn;
    char szString[100]; (null terminated string)
    char szPlayerName[100];
    char szPlayer_Name[100];
  • SoulSkorpionSoulSkorpion Join Date: 2002-04-12 Member: 423Members
    <!--QuoteBegin-OttoDestruct+Aug 22 2004, 03:51 AM--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (OttoDestruct @ Aug 22 2004, 03:51 AM)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin-->I thought hungarian notation was this:

    int main void {

    if (blahblah == blahblah) {

    }
    }

    Where you put the } after any statement instead of a new line.<!--QuoteEnd--></td></tr></table><div class='postcolor'><!--QuoteEEnd-->
    No... I think that's called "The One True Brace Style" (<a href='http://info.astrian.net/jargon/terms/i/indent_style.html' target='_blank'>no joke</a>). I don't use it, myself.
  • DOOManiacDOOManiac Worst. Critic. Ever. Join Date: 2002-04-17 Member: 462Members, NS1 Playtester
    The HL SDK uses Hungarian notation rather extensively, so I don't find it to be a big deal. At work we don't have a standard notation, and some people use different things and its quite hectic, so I wish we did...
  • ElvenThiefElvenThief aka Elven Thief (ex. NS Programmer) Join Date: 2002-11-15 Member: 8754Members, Retired Developer, NS1 Playtester, Constellation
    I think it's to be expected, seeing as valvE was started from ex-Microsoft employees
  • funbagsfunbags Join Date: 2003-06-08 Member: 17099Members
    <!--QuoteBegin-E-Th33ph+Aug 22 2004, 02:36 AM--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (E-Th33ph @ Aug 22 2004, 02:36 AM)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin--> I think it's to be expected, seeing as valvE was started from ex-Microsoft employees <!--QuoteEnd--> </td></tr></table><div class='postcolor'> <!--QuoteEEnd-->
    i thought guys from ID split off to form valve
  • DOOManiacDOOManiac Worst. Critic. Ever. Join Date: 2002-04-17 Member: 462Members, NS1 Playtester
    No no no. No. Most came from Microsoft initially. I think it was Gabe Newell who did the programming on window's built in Solitare.
  • SkulkBaitSkulkBait Join Date: 2003-02-11 Member: 13423Members
    edited August 2004
    As I recall, Hungarian Notation was originaly invented at Microsoft in order to help coordinate the vast ammounts of programmers working on any given project.
    Of course, nowadays it is mostly used as the tactical nuclear weapon of source code obfuscation (the key to a programmer's job security):

    <!--QuoteBegin--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> </td></tr><tr><td id='QUOTE'><!--QuoteEBegin-->
        * Insist on carrying outright orthogonal information in your Hungarian warts. Consider this real world example: "a_crszkvc30LastNameCol". It took a team of maintenance engineers nearly 3 days to figure out that this whopper variable name described a const, reference, function argument that was holding information from a database column of type Varchar[30] named "LastName" which was part of the table's primary key. When properly combined with the principle that "all variables should be public" this technique has the power to render thousands of lines of source code obsolete instantly!<!--QuoteEnd--></td></tr></table><div class='postcolor'><!--QuoteEEnd-->
    --http://mindprod.com/unmainnaming.html

    I don't use it personally, nor the "One True Brace Style" (which makes no sense at all and is rather ugly to read), but I've heard people who use it say good and bad things... mostly bad.

    I also feel the need to point out that unlike OpenGL, OpenAL is not a standard and is not controlled by an ARB. It was invented (IIRC) by Loki and Creative to aid crossplatform development. It actually uses DirectSound when running on Windows. And annother difference between OpenGL and D3D is that OpenGL is generally considered easier to work with.
  • taboofirestaboofires Join Date: 2002-11-24 Member: 9853Members
    You see OGL a lot more in non-videogame areas, like multimedia and graphics.

    And I like the K&R "one true brace" style. It's not like you don't know the opening brace is there if you indent properly, so I'll save the whitespace and extra line.
  • DOOManiacDOOManiac Worst. Critic. Ever. Join Date: 2002-04-17 Member: 462Members, NS1 Playtester
    Its all personal preference.

    I cannot stand to see the { at the end of a line, its gotta all be spaced out or its just frustrating. Not so much for 1 or 2 liners but if its nested if's, its a must. Whenever I'm working w/ code one of my coworkers wrote I usually spend 5 minutes just expanding the braces... heh
Sign In or Register to comment.