CFanatic

Go Back   CFanatic > Advance Programming > OpenGL Programming

Join CFanatic Forum Now

OpenGL multiple windows in multiple threads topic posted under OpenGL Programming which is a part of Advance Programming category in CFanatic Forum
Reply
 
Thread Tools Display Modes
  #1  
Old 09-13-2010, 09:17 AM
Junior Member
 
Join Date: Sep 2010
Posts: 4
Thanks: 0
Thanked 1 Time in 1 Post
Hamed is on a distinguished road
| More
Thumbs down OpenGL multiple windows in multiple threads

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
Reply With Quote
  #2  
Old 09-13-2010, 10:51 PM
shabbir's Avatar
Administrator
 
Join Date: Sep 2006
Posts: 1,163
Thanks: 57
Thanked 63 Times in 44 Posts
shabbir has a spectacular aura aboutshabbir has a spectacular aura about
| More
Re: OpenGL multiple windows in multiple threads

Most of the time Segmentation fault comes when you are using a variable which has not be allocated a memory.
Reply With Quote
  #3  
Old 09-17-2010, 07:28 AM
Junior Member
 
Join Date: Sep 2010
Posts: 4
Thanks: 0
Thanked 1 Time in 1 Post
Hamed is on a distinguished road
| More
Exclamation Re: OpenGL multiple windows in multiple threads

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
Reply With Quote
  #4  
Old 09-17-2010, 09:22 AM
shabbir's Avatar
Administrator
 
Join Date: Sep 2006
Posts: 1,163
Thanks: 57
Thanked 63 Times in 44 Posts
shabbir has a spectacular aura aboutshabbir has a spectacular aura about
| More
Re: OpenGL multiple windows in multiple threads

Quote:
Originally Posted by Hamed View Post
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
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 ?
Reply With Quote
  #5  
Old 09-18-2010, 12:26 AM
Junior Member
 
Join Date: Sep 2010
Posts: 4
Thanks: 0
Thanked 1 Time in 1 Post
Hamed is on a distinguished road
| More
Re: OpenGL multiple windows in multiple threads

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
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
multiple getchar() in a row MareoRaft C Programming 0 08-28-2010 03:11 AM
Multiple ref Parameters kendaop C# Programming 0 08-28-2010 03:11 AM
multiple getchar() in a row MareoRaft C Programming 0 08-28-2010 03:11 AM
How to Find Right Child Window handle of an application with multiple Child Windows hypheni Win32 Programming 1 06-24-2010 05:33 AM
msdos character mode console programming- multiple windows HowardL Driver Development 0 08-05-2007 11:35 AM

 

Advertisement

CFanatic Search
Custom Search

Advertisement

All times are GMT -5. The time now is 03:02 AM.



Powered by vBulletin® Version 3.7.4
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO ©2010, Crawlability, Inc.
Cfanatic.com is a premier member of the IDG TechNetwork. For advertising opportunities contact here
Get Paid for Working on Projects Matching Your Expertise at Go4Expert's Jobs Board