View Poll Results: OpenGL or DirectX?

Voters
22. You may not vote on this poll
  • OpenGL

    9 40.91%
  • DirectX

    13 59.09%

DirectX/OpenGL

This is a discussion on DirectX/OpenGL within the Game Programming forums, part of the General Programming Boards category; dunno, opengl is pretty darn easy...

  1. #16
    Registered User
    Join Date
    Jul 2002
    Posts
    273
    dunno, opengl is pretty darn easy
    always looking, make an offer. get me out of this place.

  2. #17
    Registered User VBprogrammer's Avatar
    Join Date
    Mar 2002
    Posts
    175
    I have seen that. you can't play the game?
    Well since most major games are made using one of these API's then you can be pretty safe that they will work on most people's computers. As for which is easier i would go for OpenGL however i haven't done much DX stuff so its up to you.
    VC++ 6

  3. #18
    x4000 Ruski's Avatar
    Join Date
    Jun 2002
    Location
    Outer Space!
    Posts
    542
    Ok I guess I'll go with OpenGL Wish me luck
    what does signature stand for?

  4. #19
    Has a Masters in B.S.
    Join Date
    Aug 2001
    Posts
    2,267
    sorry, for dissapearing.

    >I'm not sure about this cause I never got an answer out of anyone here but I think OpenGL is not thread safe and DirectX is.

    OpenGL is thread safe. you just have to synchronize multiple RC's yourself.

    >OpenGL is a "state machine" which means everything is global states.

    "State machine" just means everything is done using states and state switching, such as the current matrix, texture modes, ect.

    state are exclusive to their respective RC's

    >With DirectX, game manufacturers are able to distribute it.

    not quite just newer versions of the software renderer, only on windows, software OpenGL ships with windows, all versions above 2 i think. on linux you may have to manually install mesaGL for software.
    ADVISORY: This users posts are rated CP-MA, for Mature Audiences only.

  5. #20
    Registered User
    Join Date
    Jul 2002
    Posts
    273
    Originally posted by no-one
    OpenGL is thread safe. you just have to synchronize multiple RC's yourself.
    Thread safe means that you can enter the library in multiple threads at the same time. Since you have to switch the "current" RC before you can act on another, you aren't able to enter the library from the thread handling the second RC. the second thread has to wait. therefore it is not threadsafe.
    Originally posted by no-one "State machine" just means everything is done using states and state switching, such as the current matrix, texture modes, ect.

    state are exclusive to their respective RC's
    wglMakeCurrent(HDC, HGLRC);

    This is a prime example of a global state. All others depend on at least this being set globally. The instance is switched at that function and you CAN'T enter OpenGL to work on another instance until you switch it globally again. thread has to wait. Not threadsafe
    always looking, make an offer. get me out of this place.

  6. #21
    Registered User VBprogrammer's Avatar
    Join Date
    Mar 2002
    Posts
    175
    Geazz...And you thought i didn't understand multitasking. j/k. OpenGL works very well and none of this theretical - doesn't apply to real life - programming stuff is going to change that. However so does DX so if silly things like that really annoy you then sure go with DX but the choice is yours.
    VC++ 6

  7. #22
    Registered User
    Join Date
    Feb 2002
    Posts
    591
    Have any one seen any tutorials for Opengl or DirectX for C#/.NET ?.

  8. #23
    Has a Masters in B.S.
    Join Date
    Aug 2001
    Posts
    2,267
    >
    Thread safe means that you can enter the library in multiple threads at the same time.
    <

    yeah you can.

    >
    Since you have to switch the "current" RC before you can act on another.
    <

    no you don't, only if the RC's are sharing a DC, which is the limiting factor. The Host OS/system/hardware.

    >
    you aren't able to enter the library from the thread handling the second RC.
    <

    because the second RC(if sharing the same DC) are in the same library instance.

    > the second thread has to wait. therefore it is not threadsafe.

    OpenGL is thread safe, it only has to wait because of the host system.

    anyway, on a single processor system multithreading is faked so it doesn't really matter.

    >
    This is a prime example of a global state. All others depend on at least this being set globally. The instance is switched at that function and you CAN'T enter OpenGL to work on another instance until you switch it globally again. thread has to wait. Not threadsafe
    <

    wrong, see the above.
    ADVISORY: This users posts are rated CP-MA, for Mature Audiences only.

  9. #24
    Christian
    Join Date
    Mar 2002
    Posts
    618
    Originally posted by Barjor
    Have any one seen any tutorials for Opengl or DirectX for C#/.NET ?.
    sunlight's site has some for directx 8. Though you might want to wait for DX 9.
    I shall call egypt the harmless dragon

    -Isaiah 30.7

  10. #25
    Registered User
    Join Date
    Jul 2002
    Posts
    273
    Originally posted by no-one
    >
    Thread safe means that you can enter the library in multiple threads at the same time.
    <

    yeah you can.

    >
    Since you have to switch the "current" RC before you can act on another.
    <

    no you don't, only if the RC's are sharing a DC, which is the limiting factor. The Host OS/system/hardware.

    >
    you aren't able to enter the library from the thread handling the second RC.
    <

    because the second RC(if sharing the same DC) are in the same library instance.

    > the second thread has to wait. therefore it is not threadsafe.

    OpenGL is thread safe, it only has to wait because of the host system.

    anyway, on a single processor system multithreading is faked so it doesn't really matter.

    >
    This is a prime example of a global state. All others depend on at least this being set globally. The instance is switched at that function and you CAN'T enter OpenGL to work on another instance until you switch it globally again. thread has to wait. Not threadsafe
    <

    wrong, see the above.
    Wow, is that a lack of understanding of Windows or what!?!?

    In a single process you have ONE instance of a loaded library. No matter how many times you LoadLibrary() you will have the same set of global variables in the dll address space. OpenGL loaded in multiple threads is still a single address space. You don't get multiple instances across threads in a single process. I am shocked that you have been thinking this way this whole time.
    always looking, make an offer. get me out of this place.

  11. #26
    Registered User
    Join Date
    Jul 2002
    Posts
    273
    perhaps an pseudocode example is necessary:

    //working in thread1

    SetCurrentRC (rc1)
    glClear()
    glBegin(GL_POLYGON)

    //Context switch
    //working in thread2

    list2 = CreateDisplayList()
    glBegin(GL_POLYGON)
    glVertex(ptr,....)

    //Context switch
    //working in thread1

    glVertex(ptr,...)
    glVertex(ptr...)
    glVertex(ptr...)
    glEnd()

    if you really look at this you'll understand why openGL is not thread-safe. Context switching in the middle of an openGL procedure will KILL what you're trying to do. Sorry if I'm being a bit nasty now but you're being way more cocky than your knowledge should allow
    always looking, make an offer. get me out of this place.

  12. #27
    Banned Troll_King's Avatar
    Join Date
    Oct 2001
    Posts
    1,784
    Microsoft DX is pushed by advertising and big dollars, while OpenGL is used because it renders high quality 3d graphics. They are both used on the Microsoft OS but in taking a wider view of computers, OpenGL is the only solution. In addition the monopoly is trying to steal OpenGL I hear.

  13. #28
    Has a Masters in B.S.
    Join Date
    Aug 2001
    Posts
    2,267
    >
    In a single process you have ONE instance of a loaded library. No matter how many times you LoadLibrary() you will have the same set of global variables in the dll address space. OpenGL loaded in multiple threads is still a single address space. You don't get multiple instances across threads in a single process. I am shocked that you have been thinking this way this whole time.
    <

    honetly, its beside the point.

    >
    if you really look at this you'll understand why openGL is not thread-safe. Context switching in the middle of an openGL procedure will KILL what you're trying to do.
    <

    wtf are you talking about!!!!!!!!

    READ MY PREVIOUS POST!!!! besides that, your code is not legal anyway, and its using two rc's!!!!! to the same DC!!!!!!!! wtf?!!!

    you must synchronise the RC's as is said, if one is drawing THEN DON'T LET THE OTHER ONE DRAW!!!

    if it was not thread safe you would get a damned illegal operation every two seconds with multiple.

    >
    Sorry if I'm being a bit nasty now but you're being way more cocky than your knowledge should allow
    <

    i think not, i was making an example, multiple library instances is irellevant.

    let me clarify.

    lets say you have a DC, right? and then you make two RC's in two threads.

    and you have one thread drawing lets say an object, and the other drawing a gui. will this work? yes! why? OpenGL is thread safe.
    ADVISORY: This users posts are rated CP-MA, for Mature Audiences only.

  14. #29
    Banned Troll_King's Avatar
    Join Date
    Oct 2001
    Posts
    1,784
    no-one, have you worked with mesaGL? If so, what is your experience with it. What kind of apps can you build with it.

  15. #30
    Unregistered
    Guest
    Let's try this again with some extra comments....


    //working in thread1

    //Sets the current RC, the only RC I'm even Mentioning
    SetCurrentRC (rc1)
    //clear the RC
    glClear()
    //Get ready to draw a polygon on said DC
    glBegin(GL_POLYGON)

    //Context switch because Windows has preemptive multitasking!
    //working in thread2

    //second thread is creating a display list
    list2 = CreateDisplayList() //illegal call!!!! inside glBegin and glEnd!
    glBegin(GL_POLYGON) //two glBegins before a glEnd()!!!!
    glVertex(ptr,....)// which glBegin is this for?

    //Context switch
    //working in thread1

    glVertex(ptr,...) //this was intended to draw to the dc but somehow it seems to be in the display list
    glVertex(ptr...)
    glVertex(ptr...)
    glEnd() //for which glBegin?


    multi-threading is overlapping. this destroys any procedural nature that OpenGL requires. Is your mind that small?

Page 2 of 5 FirstFirst 12345 LastLast
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. shaders: directx/opengl
    By Raven Arkadon in forum Game Programming
    Replies: 5
    Last Post: 08-24-2006, 09:19 AM

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