Jump to content
  • Advertisement
Sign in to follow this  
asdfwe

very interesting problem

This topic is 3848 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

i have a doubt regarding my program in which open gl window becomes inactive after a certain time the code looks like this float c=0.1; int d=0; do { d++; if(d>100) exit(0); glColor3f(0,1,0); glBegin(GL_LINES); glVertex2d(c,c); glVertex2d(c+1,c+.4); glEnd(); SwapBuffers (hDC); system("dir"); c=c+.1; }while(1) initially lines are made but after some time , the opengl window i suppose becomes inactive window or so ...... actually it stops drawing lines anymore however the dir command executes at command prompt as the command prompt box continues to execute again and again,, but lines are not made what is the fault ???????? thanks in advance the interesting part is this when i debug my program , it does makes lines i.e performs its function completely but when i run it , it does the above problam (drawing lines only for some time) i am using dev c++ thanks in advance

Share this post


Link to post
Share on other sites
Advertisement
I think your window's becoming inactive because your application isn't processing messages from Windows. To Windows this means it looks as though your application has crashed, so it responds appropriately.

Googling 'Windows Message Loop' brings up a number of articles which should help you with this problem, such as this one:

http://www.mvps.org/directx/articles/writing_the_game_loop.htm

Hope that helps.

Share this post


Link to post
Share on other sites
Are you sure the 'dir' command is still being executed when the window's become inactive? It's not just queued the 100 commands and is slowly churning through them, I mean?

Share this post


Link to post
Share on other sites
"
Are you sure the 'dir' command is still being executed when the window's become inactive? It's not just queued the 100 commands and is slowly churning through them, I mean?
"

yes , as even if i wrote ping yahoo.com in place of dir , the ping command executes again and again with with opengl window being inactive and no lines are drawn ....... but when i debug it , it is working absolutely fine.

cant understand why

please help



Share this post


Link to post
Share on other sites
0) You have a question, not a doubt. (This seems to be a very common English error nowadays; I have no idea why.)
1) That's a horrible way to debug.
2) Your loop increases the value of 'c' each time, which is used to determine where the line is drawn. Eventually, the line position will move to somewhere off the screen.

Share this post


Link to post
Share on other sites
Quote:
Original post by Zahlman
0) You have a question, not a doubt. (This seems to be a very common English error nowadays; I have no idea why.)

As you probably guessed, the two terms are interchangeable in many other languages. I'm not an expert, but this is a very common mistake for Indian speakers as the two words are synonymous in their language. Furthermore, the two terms are often more correctly used the other way around from English in certain languages, apparently, including Italian.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!