Which is best DirectX or OpenGL

This is a discussion on Which is best DirectX or OpenGL within the Game Programming forums, part of the General Programming Boards category; Well, If you think that 8% is not worth programming for, you're software will not that successfull as if it ...

  1. #16
    Registered User PotitKing's Avatar
    Join Date
    Dec 2001
    Posts
    28
    Well, If you think that 8% is not worth programming for, you're software will not that successfull as if it used OpenGL. It seems to me that everyone just thinks DirectX is the only possible solution, and it handels input, sound etc. Well, this can also be accomplished with various of libraries like Allegro, ClanLib, SDL.

    Besides, those 8% not using MS windows today, may be 20% in a few years. You can't rely on todays situation. I can agree that it's convenient to have a DirectX syntax to everything in your game, but I believe that you have to search an API that you like for yourself. Be open minded, and try out many, look into the documentation of the API's.
    % gcc -v
    Configured with: FreeBSD/i386 system compiler
    Thread model: posix
    gcc version 3.3.3 [FreeBSD] 20031106

  2. #17
    Rabite SirCrono6's Avatar
    Join Date
    Nov 2003
    Location
    California, US
    Posts
    269
    It all depends on what you want to learn. OpenGL is easier, but that's not really a reason to call it "better". A lot of companys use DirectX so it would be good to learn it. Also, you should learn the one that you have the best resource for, for example: I have a C++ book. I want to learn DirectX or OpenGL. My book teaches DirectX. Therefore, I will most likely learn DirectX. But I think it would be best to learn both, that way if you made a DirectX thing and an OpenGL thing, you get 100%.

    - SirCrono6
    From C to shining C++!

    Great graphics, sounds, algorithms, AI, pathfinding, visual effects, cutscenes, etc., etc. do NOT make a good game.
    - Bubba

    IDE and Compiler - Code::Blocks with MinGW
    Operating System - Windows XP Professional x64 Edition

  3. #18
    Super Moderator VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,590
    Well, If you think that 8% is not worth programming for, you're software will not that successfull as if it used OpenGL. It seems to me that everyone just thinks DirectX is the only possible solution, and it handels input, sound etc. Well, this can also be accomplished with various of libraries like Allegro, ClanLib, SDL.
    All video cards support DirectX - all. Not all natively support OpenGL. All the libraries you mention support the reason for using DirectX - why use twenty libraries to accomplish what one API can do? And just because my game does not support OpenGL or does support OpenGL does not mean it will be successful or a flop. That is not even a fair statement. Games do well based on whats in the game, not what library it uses to accomplish what it does. I'm telling ya, the days of proprietary graphic API's for certain video cards are coming to an end. DirectX will be all there is. 3Dfx API fell by the way side even though it was easier to use and had less dev time than DirectX. Granted 3Dfx fell for a host of other reasons not related to this topic but you get the jist of what I'm saying.

    Geez I feel like a MS crusader here, which I'm not, but DirectX is a very good, very stable, very modern, very versatile, and very easy to use API. Just try it.

  4. #19
    'AlHamdulillah
    Join Date
    Feb 2003
    Posts
    790
    Besides, those 8% not using MS windows today, may be 20% in a few years.
    what market are we talking about here, global or US. You are definately right in the global outlook of things, as asia is progressing towards its own Unix system, however, they also dont want any foreign developers(tough luck for Euros/Americans there). The EU is also progressing towards its own software, and may be alittle more open towards Americans, but not much. So this market advantage you are talking about will not exist for Americans due to inter-governmental troubles.

    All video cards support DirectX - all. Not all natively support OpenGL. All the libraries you mention support the reason for using DirectX - why use twenty libraries to accomplish what one API can do? And just because my game does not support OpenGL or does support OpenGL does not mean it will be successful or a flop.
    exactly, in the end, it is the content of the actual game that determines whether it becomes a flop or a success. what people dont realize is that the base graphics engine is usually the fastest thing to be done, and it is the actual content(AI,Physics,etc) that takes the time(this is in general, as DOOM3 took several years for its graphics engine to become complete).

    Learn both APIs as possible, but if it had to be one, I would go with DirectX, as it is as mentioned above, the only API to have 100% support by video cards.

    EDIT: and another example of how DirectX makes it easier to do rotation if you dont want to program your own(you still need to know matrical math for the view matrix update however).

    Code:
    void ICamera::Yaw(float degrees)
    {
        D3DXMATRIX mR;
    
        degrees = (degrees *D3DX_PI)/180;
    
        D3DXMatrixRotationY(&mR,degrees);
    
        D3DXVec3TransformCoord(&vRight,&vRight,&mR);
        D3DXVec3TransformCoord(&vAt,&vAt,&mR);
    };
    
    void ICamera::Pitch(float degrees)
    {
        D3DXMATRIX mR;
    
        degrees = (degrees * D3DX_PI)/180;
    
        D3DXMatrixRotationX(&mR,degrees);
    
        D3DXVec3TransformCoord(&vUp,&vUp,&mR);
        D3DXVec3TransformCoord(&vAt,&vAt,&mR);
    };
    I still recommend writing your own rotation functions and try to optimize, but you probably wont be any faster than the D3DX function
    Last edited by EvBladeRunnervE; 01-18-2004 at 03:29 PM.

  5. #20
    Registered User heat511's Avatar
    Join Date
    Dec 2001
    Posts
    169

    my take on it

    here's how im doing it... learning opengl first because it is easier for beginners... http://nehe.gamedev.net is an excellent source btw) then once i understand all of the concepts of 3d programs, like rotation, lighting, etc. go learn directx because i conceptually understand everything. it will never hurt to know both but i think opengl is better to start with because it's easier. although i do agree that being able to do everything w/ directx is very nice and blizzard uses directx meaning if you want a job there you gotta learn it.
    "uh uh uh, you didn't say the magic word"
    -Jurassic Park

  6. #21
    Banned
    Join Date
    Jan 2003
    Posts
    1,708
    I'm completely coding all of my matrix and mathematics stuff...in fact, the only REASON I really even do 3D programming is because i really enjoy solving complex problems ...I am not big on playing games, in fact, afaik even carmack didn't really like playing games, and he's really successful

  7. #22
    'AlHamdulillah
    Join Date
    Feb 2003
    Posts
    790
    I'm completely coding all of my matrix and mathematics stuff...in fact, the only REASON I really even do 3D programming is because i really enjoy solving complex problems
    Im almost at that point to, which is why I still have all of those matrix functions still written up which I will optimize with assembler once I learn more of it(matrical inversion without using the determinant really is a pain in the ass to get working right).

  8. #23
    Banned
    Join Date
    Jan 2003
    Posts
    1,708
    honestly it's pretty much next to impossible to optimize with assembly. I've re-written things like sqrt and almost all of my mathematics stuff, and even the C standard stuff runs way faster.

    The only way to get good optimizations is to get into SIMD optimizations and 3D now, which isn't supported on every processor. Some of that stuff gets pretty hairy, but i wouldn't worry about optimizing until you've actually got something that runs.
    Last edited by Silvercord; 01-21-2004 at 11:19 AM.

  9. #24
    'AlHamdulillah
    Join Date
    Feb 2003
    Posts
    790
    you are right for most basic math functions, but when it comes time to SSE optimized, you can cut alot of garbage out of the outputted assembly by handcoding it(for example, on gamedev.net, one person cut the outputted assembly from 20 instructions using the stack(MS VC outputted assembler code) down to 3 instructions at a pretty high performance gain.)

    I wasnt planning on optimizing any of my stuff until I get it to where it works and the only thing holding me back is my code's speed.

Page 2 of 2 FirstFirst 12
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Going from DirectX to OpenGL
    By Wraithan in forum Game Programming
    Replies: 19
    Last Post: 02-24-2006, 10:07 AM
  2. Allegro, OpenGL.. or even DirectX?
    By Zeusbwr in forum C++ Programming
    Replies: 1
    Last Post: 11-14-2004, 07:16 AM
  3. Which is better: OpenGL or DirectX
    By Stan100 in forum Game Programming
    Replies: 2
    Last Post: 05-09-2003, 04:43 PM
  4. OpenGL 2 or DirectX ?
    By alex6852 in forum A Brief History of Cprogramming.com
    Replies: 9
    Last Post: 01-02-2003, 01:31 PM
  5. So.. what's the difference between DirectX and OpenGL?
    By QuestionC in forum Game Programming
    Replies: 6
    Last Post: 01-19-2002, 05:18 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21