1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

OpenGL multiple windows in multiple threads

Discussion in 'C++' started by imported_Hamed, Sep 13, 2010.

  1. imported_Hamed

    imported_Hamed New Member

    Joined:
    Sep 13, 2010
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    0
    In the name of Allah(God)
    Hello
    I compiled the program on the following link:

    code.bsd64.org/browse/openbsd/HEAD/xenocara/dist/Mesa/progs/xdemos/sharedtex_mt.c

    It compiled properly but when I run the program, I recieved a run time error "Segmentation fault". I knew that the glXMakeCurrent function works properly and when the program wants to run fist GL function after glXMakeCurrent function makes run time error.
    I also knew if we write this program without threading, the program will work properly.
    Please, help me how to solve this problem
    Thanks in advance
    Hamed
     
  2. NewsBot

    NewsBot New Member

    Joined:
    Dec 2, 2008
    Messages:
    1,267
    Likes Received:
    2
    Trophy Points:
    0
    Most of the time Segmentation fault comes when you are using a variable which has not be allocated a memory.
     
  3. imported_Hamed

    imported_Hamed New Member

    Joined:
    Sep 13, 2010
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    0
    In the name of Allah
    Thanks Shabbir for your reply but your reply doesn't solve my problem because this code works properly if it is written without threading
    Please, answer the question with more details
    Thanks in advance
    Hamed
     
  4. NewsBot

    NewsBot New Member

    Joined:
    Dec 2, 2008
    Messages:
    1,267
    Likes Received:
    2
    Trophy Points:
    0
    You have not asked the question with the needed details for me to answer to the great detail possible.

    Where does segmentation fault happens and in what condition ?
     
  5. imported_Hamed

    imported_Hamed New Member

    Joined:
    Sep 13, 2010
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    0
    In the name of Allah
    Hello
    Thanks again for spending time to answer my question.
    Segmentation fault happens in Redraw function after glXMakeCurrent function works properly, glPushMatrix function I think or the one of above OpenGL function.
    I knew this problem happens when we use thread, if we don't use thread this problem won't happen.

    Thanks in advance
    Hamed
     

Share This Page